Documentation ¶
Index ¶
- type Store
- func (m *Store) CheckAuthorizationCodeByID(ctx context.Context, tokenID string) (bool, error)
- func (m *Store) DeleteClient(ctx context.Context, client *model.Client) error
- func (m *Store) DeleteClientByID(ctx context.Context, clientID string) error
- func (m *Store) GetAllClientsByOwner(ctx context.Context, owner string) ([]*model.Client, error)
- func (m *Store) GetClientByID(ctx context.Context, clientID string) (*model.Client, error)
- func (m *Store) StoreClient(ctx context.Context, client *model.Client) (*model.Client, error)
- func (m *Store) StoreUsedAuthorizationCode(ctx context.Context, code *model.OAuthAuthorizationCode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements ClientRepository and AuthCodeRepository storing data in MongoDB collections.
func New ¶
New creates a new Store which has implementations for all the repositories required by the Authorization Server.
func (*Store) CheckAuthorizationCodeByID ¶
CheckAuthorizationCodeByID checks if the given tokenID is stored as used in the persistence. If so, it returns true.
func (*Store) DeleteClient ¶
DeleteClient removes the given client from the persistence. It should not fail if the client was already removed.
func (*Store) DeleteClientByID ¶
DeleteClientByID removes the client with the given ID from the persistence. It should not fail if the client was already removed.
func (*Store) GetAllClientsByOwner ¶
GetAllClientsByOwner obtains all the clients from the persistence which owner is the given user. If there aren'y any clients owned by that user, an empty slice is returned.
func (*Store) GetClientByID ¶
GetClientByID obtains a client from the persistence with the given clientID. If there isn't a client with the provided ID, (nil, nil) is returned.
func (*Store) StoreClient ¶
StoreClient stores a client in the persistence. If a client with the same clientID already exists, it's overwritten. If something goes wrong an error is returned.
func (*Store) StoreUsedAuthorizationCode ¶
func (m *Store) StoreUsedAuthorizationCode(ctx context.Context, code *model.OAuthAuthorizationCode) error
StoreUsedAuthorizationCode stores a used authorization code in the storage. It should not fail if the code is already stored.