Documentation
¶
Index ¶
- Variables
- func NewResourceURI(ctx context.Context, str string) newResourceURI
- func NewScope(ctx context.Context, str string) newScope
- type ClientResourceScopeService
- type Commands
- func (c *Commands) AddResourceToClientID(ctx context.Context, resourceURI, clientID string) error
- func (c *Commands) AddScopesToClientID(ctx context.Context, resourceURI, clientID string, scopes []string) ([]*model.Scope, error)
- func (c *Commands) CreateResource(ctx context.Context, options *NewResourceOptions) (*model.Resource, error)
- func (c *Commands) CreateScope(ctx context.Context, resourceURI string, options *NewScopeOptions) (*model.Scope, error)
- func (c *Commands) DeleteResourceByURI(ctx context.Context, uri string) error
- func (c *Commands) DeleteScope(ctx context.Context, resourceURI string, scope string) error
- func (c *Commands) GetResourceByURI(ctx context.Context, uri string) (*model.Resource, error)
- func (c *Commands) RemoveResourceFromClientID(ctx context.Context, resourceURI, clientID string) error
- func (c *Commands) RemoveScopesFromClientID(ctx context.Context, resourceURI, clientID string, scopes []string) ([]*model.Scope, error)
- func (c *Commands) ReplaceScopesOfClientID(ctx context.Context, resourceURI, clientID string, scopes []string) ([]*model.Scope, error)
- func (c *Commands) UpdateResource(ctx context.Context, options *UpdateResourceOptions) (*model.Resource, error)
- func (c *Commands) UpdateScope(ctx context.Context, options *UpdateScopeOptions) (*model.Scope, error)
- type FormatResourceURI
- type FormatScopeToken
- type ListResourceResult
- type ListResourcesOptions
- type ListScopeOptions
- type ListScopeResult
- type NewResourceOptions
- type NewScopeOptions
- type Queries
- func (q *Queries) GetManyResourceClientIDs(ctx context.Context, resourceIDs []string) (map[string][]string, error)
- func (q *Queries) GetManyResources(ctx context.Context, ids []string) ([]*model.Resource, error)
- func (q *Queries) GetManyScopes(ctx context.Context, ids []string) ([]*model.Scope, error)
- func (q *Queries) GetResourceByID(ctx context.Context, id string) (*model.Resource, error)
- func (q *Queries) GetResourceByURI(ctx context.Context, uri string) (*model.Resource, error)
- func (q *Queries) GetScope(ctx context.Context, resourceURI string, scope string) (*model.Scope, error)
- func (q *Queries) ListResources(ctx context.Context, options *ListResourcesOptions, ...) (*ListResourceResult, error)
- func (q *Queries) ListScopes(ctx context.Context, resourceID string, options *ListScopeOptions, ...) (*ListScopeResult, error)
- type Resource
- type Scope
- type Store
- func (s *Store) AddResourceToClientID(ctx context.Context, resourceID, clientID string) error
- func (s *Store) AddScopesToClientID(ctx context.Context, resourceID string, scopeIDs []string, clientID string) error
- func (s *Store) CreateResource(ctx context.Context, r *Resource) error
- func (s *Store) CreateScope(ctx context.Context, scope *Scope) error
- func (s *Store) DeleteAllClientResourceAssociations(ctx context.Context, resourceID string) error
- func (s *Store) DeleteAllClientScopeAssociationsByResourceID(ctx context.Context, resourceID string) error
- func (s *Store) DeleteAllClientScopeAssociationsByScopeID(ctx context.Context, scopeID string) error
- func (s *Store) DeleteAllResourceScopes(ctx context.Context, resourceID string) error
- func (s *Store) DeleteResource(ctx context.Context, id string) error
- func (s *Store) DeleteScope(ctx context.Context, resourceURI string, scope string) error
- func (s *Store) GetClientResource(ctx context.Context, clientID, resourceID string) (*Resource, error)
- func (s *Store) GetManyResources(ctx context.Context, ids []string) ([]*Resource, error)
- func (s *Store) GetManyScopes(ctx context.Context, ids []string) ([]*Scope, error)
- func (s *Store) GetResourceByID(ctx context.Context, id string) (*Resource, error)
- func (s *Store) GetResourceByURI(ctx context.Context, uri string) (*Resource, error)
- func (s *Store) GetResourceScope(ctx context.Context, resourceID string, scope string) (*Scope, error)
- func (s *Store) GetScopeByID(ctx context.Context, id string) (*Scope, error)
- func (s *Store) GetScopesByResourceIDAndScopes(ctx context.Context, resourceID string, scopes []string) (map[string]*Scope, error)
- func (s *Store) ListClientIDsByResourceIDs(ctx context.Context, resourceIDs []string) (map[string][]string, error)
- func (s *Store) ListClientScopesByResourceID(ctx context.Context, resourceID, clientID string) ([]*Scope, error)
- func (s *Store) ListResources(ctx context.Context, options *ListResourcesOptions, ...) (*storeListResourceResult, error)
- func (s *Store) ListScopes(ctx context.Context, resourceID string, options *ListScopeOptions, ...) (*storeListScopeResult, error)
- func (s *Store) NewResource(options *NewResourceOptions) *Resource
- func (s *Store) NewScope(resource *Resource, options *NewScopeOptions) *Scope
- func (s *Store) RemoveResourceFromClientID(ctx context.Context, resourceID, clientID string) error
- func (s *Store) RemoveScopesFromClientID(ctx context.Context, scopeIDs []string, clientID string) error
- func (s *Store) UpdateResource(ctx context.Context, options *UpdateResourceOptions) error
- func (s *Store) UpdateScope(ctx context.Context, options *UpdateScopeOptions) error
- type UpdateResourceOptions
- type UpdateScopeOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var DependencySet = wire.NewSet( wire.Struct(new(Store), "*"), wire.Struct(new(Queries), "*"), wire.Struct(new(Commands), "*"), wire.Struct(new(ClientResourceScopeService), "*"), )
View Source
var ErrClientNotFound = apierrors.NotFound.WithReason("ClientNotFound").New("client not found")
View Source
var ErrResourceDuplicateURI = apierrors.BadRequest.WithReason("ResourceDuplicateURI").New("duplicate resource uri")
View Source
var ErrResourceNotAssociatedWithClient = apierrors.Forbidden.WithReason("ResourceNotAssociatedWithClient").New("resource is not associated with the client")
View Source
var ErrResourceNotFound = apierrors.NotFound.WithReason("ResourceNotFound").New("resource not found")
View Source
var ErrScopeDuplicate = apierrors.BadRequest.WithReason("ScopeDuplicate").New("duplicate scope")
View Source
var ErrScopeNotFound = apierrors.NotFound.WithReason("ScopeNotFound").New("scope not found")
Functions ¶
func NewResourceURI ¶
Types ¶
type ClientResourceScopeService ¶
type ClientResourceScopeService struct {
Store *Store
}
func (*ClientResourceScopeService) GetClientResourceByURI ¶
func (*ClientResourceScopeService) GetClientResourceScopes ¶
type Commands ¶
type Commands struct {
Store *Store
OAuthConfig *config.OAuthConfig
}
func (*Commands) AddResourceToClientID ¶
func (*Commands) AddScopesToClientID ¶
func (*Commands) CreateResource ¶
func (*Commands) CreateScope ¶
func (*Commands) DeleteResourceByURI ¶
func (*Commands) DeleteScope ¶
func (*Commands) GetResourceByURI ¶
func (*Commands) RemoveResourceFromClientID ¶
func (*Commands) RemoveScopesFromClientID ¶
func (*Commands) ReplaceScopesOfClientID ¶
func (*Commands) UpdateResource ¶
func (*Commands) UpdateScope ¶
type FormatResourceURI ¶
type FormatResourceURI struct{}
func (FormatResourceURI) CheckFormat ¶
func (FormatResourceURI) CheckFormat(ctx context.Context, value interface{}) error
type FormatScopeToken ¶
type FormatScopeToken struct{}
func (FormatScopeToken) CheckFormat ¶
func (FormatScopeToken) CheckFormat(ctx context.Context, value interface{}) error
type ListResourceResult ¶
type ListResourcesOptions ¶
type ListScopeOptions ¶
type ListScopeResult ¶
type NewResourceOptions ¶
type NewResourceOptions struct {
URI newResourceURI
Name *string
}
type NewScopeOptions ¶
type NewScopeOptions struct {
Scope newScope
Description *string
}
type Queries ¶
type Queries struct {
Store *Store
}
func (*Queries) GetManyResourceClientIDs ¶
func (*Queries) GetManyResources ¶
func (*Queries) GetManyScopes ¶
func (*Queries) GetResourceByID ¶
func (*Queries) GetResourceByURI ¶
func (*Queries) ListResources ¶
func (q *Queries) ListResources(ctx context.Context, options *ListResourcesOptions, pageArgs graphqlutil.PageArgs) (*ListResourceResult, error)
func (*Queries) ListScopes ¶
func (q *Queries) ListScopes(ctx context.Context, resourceID string, options *ListScopeOptions, pageArgs graphqlutil.PageArgs) (*ListScopeResult, error)
type Resource ¶
type Scope ¶
type Store ¶
type Store struct {
SQLBuilder *appdb.SQLBuilderApp
SQLExecutor *appdb.SQLExecutor
Clock clock.Clock
}
func (*Store) AddResourceToClientID ¶
func (*Store) AddScopesToClientID ¶
func (*Store) CreateResource ¶
func (*Store) DeleteAllClientResourceAssociations ¶
func (*Store) DeleteAllClientScopeAssociationsByResourceID ¶
func (*Store) DeleteAllClientScopeAssociationsByScopeID ¶
func (*Store) DeleteAllResourceScopes ¶
func (*Store) DeleteScope ¶
func (*Store) GetClientResource ¶
func (*Store) GetManyResources ¶
func (*Store) GetManyScopes ¶
func (*Store) GetResourceByID ¶
func (*Store) GetResourceByURI ¶
func (*Store) GetResourceScope ¶
func (*Store) GetScopeByID ¶
func (*Store) GetScopesByResourceIDAndScopes ¶
func (*Store) ListClientIDsByResourceIDs ¶
func (*Store) ListClientScopesByResourceID ¶
func (*Store) ListResources ¶
func (s *Store) ListResources(ctx context.Context, options *ListResourcesOptions, pageArgs graphqlutil.PageArgs) (*storeListResourceResult, error)
func (*Store) ListScopes ¶
func (s *Store) ListScopes(ctx context.Context, resourceID string, options *ListScopeOptions, pageArgs graphqlutil.PageArgs) (*storeListScopeResult, error)
func (*Store) NewResource ¶
func (s *Store) NewResource(options *NewResourceOptions) *Resource
func (*Store) NewScope ¶
func (s *Store) NewScope(resource *Resource, options *NewScopeOptions) *Scope
func (*Store) RemoveResourceFromClientID ¶
func (*Store) RemoveScopesFromClientID ¶
func (*Store) UpdateResource ¶
func (s *Store) UpdateResource(ctx context.Context, options *UpdateResourceOptions) error
func (*Store) UpdateScope ¶
func (s *Store) UpdateScope(ctx context.Context, options *UpdateScopeOptions) error
type UpdateResourceOptions ¶
type UpdateScopeOptions ¶
Click to show internal directories.
Click to hide internal directories.