Documentation ¶
Overview ¶
Package server provides an http oauth REST API
Index ¶
Constants ¶
const (
// AuthRequestParam is the name of the request token parameter
AuthRequestParam = "request_token"
)
Variables ¶
var (
// DefaultCodeChallengeMethod is the only challenge method
DefaultCodeChallengeMethod = "S256"
)
Functions ¶
This section is empty.
Types ¶
type AuthorizeParams ¶
type AuthorizeParams struct { AppURI *string `json:"app_uri"` Audience string `json:"audience"` ClientID string `json:"client_id"` CodeChallenge string `json:"code_challenge"` CodeChallengeMethod *string `json:"code_challenge_method"` RedirectURI *string `json:"redirect_uri"` ResponseType string `json:"response_type"` Scope []string `json:"scope"` State *string `json:"state"` }
AuthorizeParams contains all the bound params for the authorize operation
func (*AuthorizeParams) Validate ¶
func (p *AuthorizeParams) Validate() error
Validate validates the params
type LoginParams ¶
type LoginParams struct { Login string `json:"login"` Password string `json:"password"` RequestToken string `json:"request_token"` }
LoginParams contains all the bound params for the login operation
type LogoutParams ¶
type LogoutParams struct { Audience string `json:"audience"` ClientID string `json:"client_id"` RedirectURI *string `json:"redirect_uri"` State *string `json:"state"` }
LogoutParams contains all the bound params for the logout operation
func (LogoutParams) Validate ¶
func (p LogoutParams) Validate() error
Validate validates LogoutParams
type Option ¶
type Option func(s *Server)
Option provides the server options, these will override th defaults and instance values.
func WithAllowedGrants ¶
func WithAllowedGrants(g oauth.Permissions) Option
WithAllowedGrants sets allowed grants
func WithAuthorizer ¶
func WithAuthorizer(a oauth.Authorizer) Option
WithAuthorizer sets the oauth.Authorizer for the necessary calls
func WithCodeStore ¶
WithCodeStore changes the default code store for the server
func WithSessionStore ¶
func WithSessionStore(c oauth.SessionStore) Option
WithSessionStore changes the default session store for the server
type Server ¶
Server is an API server it can be used standalone vi Server() or integrared via Handler()
func New ¶
func New(ctrl oauth.Controller, opts ...interface{}) *Server
New returns a new Server instance
type SignupParams ¶
type SignupParams struct { Email string `json:"email"` InviteCode *string `json:"invite_code"` Login string `json:"login"` Name *string `json:"name"` Password string `json:"password"` RequestToken string `json:"request_token"` }
SignupParams contains all the bound params for the signup operation
func (SignupParams) Validate ¶
func (p SignupParams) Validate() error
Validate validates SignupParams
type TokenParams ¶
type TokenParams struct { Audience string `json:"audience"` ClientID string `json:"client_id"` ClientSecret *string `json:"client_secret,omitempty"` Code *string `json:"code,omitempty"` CodeVerifier *string `json:"code_verifier"` GrantType string `json:"grant_type"` Password *string `json:"password,omitempty"` RefreshNonce *string `json:"refresh_nonce,omitempty"` RefreshToken *string `json:"refresh_token,omitempty"` RefreshVerifier *string `json:"refresh_verifier,omitempty"` Scope []string `json:"scope,omitempty"` Username *string `json:"username,omitempty"` }
TokenParams contains all the bound params for the token operation
type UserInfoUpdateParams ¶
UserInfoUpdateParams contains all the bound params for the user info update operation