Documentation ¶
Index ¶
- func OAuth2InternalGrantFactory(config fosite.Configurator, storage interface{}, strategy interface{}) interface{}
- type AuthTokens
- type InternalGrantHandler
- func (InternalGrantHandler) CanHandleTokenEndpointRequest(ctx context.Context, request fosite.AccessRequester) bool
- func (InternalGrantHandler) CanSkipClientAuth(ctx context.Context, request fosite.AccessRequester) bool
- func (i InternalGrantHandler) HandleTokenEndpointRequest(ctx context.Context, request fosite.AccessRequester) error
- func (i InternalGrantHandler) PopulateTokenEndpointResponse(ctx context.Context, request fosite.AccessRequester, ...) error
- type UseCasesOauth
- type UseCasesOauthImpl
- func (u UseCasesOauthImpl) CreateOauthClient(ctx context.Context, input dto.OauthClientInput) (*domain.OauthClient, error)
- func (u UseCasesOauthImpl) FositeProvider() fosite.OAuth2Provider
- func (u UseCasesOauthImpl) GenerateUserAuthTokens(ctx context.Context, userID string) (*AuthTokens, error)
- func (u UseCasesOauthImpl) ListOauthClients(ctx context.Context) ([]*domain.OauthClient, error)
- func (u UseCasesOauthImpl) RefreshAuthToken(ctx context.Context, refreshToken string) (*AuthTokens, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OAuth2InternalGrantFactory ¶
func OAuth2InternalGrantFactory(config fosite.Configurator, storage interface{}, strategy interface{}) interface{}
OAuth2InternalGrantFactory creates an OAuth2 client credentials grant handler and registers an access token, refresh token and authorize code validator.
Types ¶
type AuthTokens ¶
type InternalGrantHandler ¶
type InternalGrantHandler struct { *oauth2.HandleHelper RefreshTokenStrategy oauth2.RefreshTokenStrategy RefreshTokenStorage oauth2.RefreshTokenStorage Config interface { fosite.AccessTokenLifespanProvider } }
func (InternalGrantHandler) CanHandleTokenEndpointRequest ¶
func (InternalGrantHandler) CanHandleTokenEndpointRequest(ctx context.Context, request fosite.AccessRequester) bool
CanHandleRequest indicates, if TokenEndpointInternalGrantHandler can handle this request or not. If true, HandleTokenEndpointRequest can be called.
func (InternalGrantHandler) CanSkipClientAuth ¶
func (InternalGrantHandler) CanSkipClientAuth(ctx context.Context, request fosite.AccessRequester) bool
CanSkipClientAuth indicates if client authentication can be skipped. By default it MUST be false, unless you are implementing extension grant type, which allows unauthenticated client. CanSkipClientAuth must be called before HandleTokenEndpointRequest to decide, if AccessRequester will contain authenticated client.
func (InternalGrantHandler) HandleTokenEndpointRequest ¶
func (i InternalGrantHandler) HandleTokenEndpointRequest(ctx context.Context, request fosite.AccessRequester) error
HandleTokenEndpointRequest handles an authorize request. If the handler is not responsible for handling the request, this method should return ErrUnknownRequest and otherwise handle the request.
func (InternalGrantHandler) PopulateTokenEndpointResponse ¶
func (i InternalGrantHandler) PopulateTokenEndpointResponse(ctx context.Context, request fosite.AccessRequester, responder fosite.AccessResponder) error
PopulateTokenEndpointResponse is responsible for setting return values and should only be executed if the handler's HandleTokenEndpointRequest did not return ErrUnknownRequest.
type UseCasesOauth ¶
type UseCasesOauth interface { CreateOauthClient(ctx context.Context, input dto.OauthClientInput) (*domain.OauthClient, error) FositeProvider() fosite.OAuth2Provider GenerateUserAuthTokens(ctx context.Context, userID string) (*AuthTokens, error) RefreshAuthToken(ctx context.Context, refreshToken string) (*AuthTokens, error) }
UseCasesCommunities holds all interfaces required to implement the communities feature
type UseCasesOauthImpl ¶
type UseCasesOauthImpl struct {
// contains filtered or unexported fields
}
UseCasesOauthImpl represents oauth implementation
func NewUseCasesOauthImplementation ¶
func NewUseCasesOauthImplementation(create infrastructure.Create, update infrastructure.Update, query infrastructure.Query, delete infrastructure.Delete) UseCasesOauthImpl
NewUseCasesOauthImplementation initializes an implementation of the fosite storage
func (UseCasesOauthImpl) CreateOauthClient ¶
func (u UseCasesOauthImpl) CreateOauthClient(ctx context.Context, input dto.OauthClientInput) (*domain.OauthClient, error)
CreateOauthClient is the resolver for the createOauthClient field.
func (UseCasesOauthImpl) FositeProvider ¶
func (u UseCasesOauthImpl) FositeProvider() fosite.OAuth2Provider
func (UseCasesOauthImpl) GenerateUserAuthTokens ¶
func (u UseCasesOauthImpl) GenerateUserAuthTokens(ctx context.Context, userID string) (*AuthTokens, error)
func (UseCasesOauthImpl) ListOauthClients ¶
func (u UseCasesOauthImpl) ListOauthClients(ctx context.Context) ([]*domain.OauthClient, error)
ListOauthClients is the resolver for the listOauthClients field.
func (UseCasesOauthImpl) RefreshAuthToken ¶
func (u UseCasesOauthImpl) RefreshAuthToken(ctx context.Context, refreshToken string) (*AuthTokens, error)
RefreshAuthToken is the resolver for the listOauthClients field.