Documentation
¶
Index ¶
- Variables
- type CheckRequest
- type Effect
- type GrantRequest
- type ListRequest
- type MemoryState
- type MemoryStore
- func (s *MemoryStore) DeletePluginGrants(_ context.Context, pluginInstanceID string) error
- func (s *MemoryStore) Grant(_ context.Context, req GrantRequest) (Record, error)
- func (s *MemoryStore) IsGranted(_ context.Context, req CheckRequest) (bool, []string, error)
- func (s *MemoryStore) List(_ context.Context, req ListRequest) ([]Record, error)
- func (s *MemoryStore) Revoke(_ context.Context, req RevokeRequest) (Record, error)
- func (s *MemoryStore) State() MemoryState
- type Record
- type RevokeRequest
- type SQLiteStore
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) DeletePluginGrants(ctx context.Context, pluginInstanceID string) error
- func (s *SQLiteStore) Grant(ctx context.Context, req GrantRequest) (Record, error)
- func (s *SQLiteStore) IsGranted(ctx context.Context, req CheckRequest) (bool, []string, error)
- func (s *SQLiteStore) List(ctx context.Context, req ListRequest) ([]Record, error)
- func (s *SQLiteStore) Revoke(ctx context.Context, req RevokeRequest) (Record, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CheckRequest ¶
type GrantRequest ¶
type ListRequest ¶
type MemoryState ¶
type MemoryState struct {
Records []Record `json:"records,omitempty"`
}
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func NewMemoryStoreFromState ¶
func NewMemoryStoreFromState(state MemoryState) *MemoryStore
func (*MemoryStore) DeletePluginGrants ¶
func (s *MemoryStore) DeletePluginGrants(_ context.Context, pluginInstanceID string) error
func (*MemoryStore) Grant ¶
func (s *MemoryStore) Grant(_ context.Context, req GrantRequest) (Record, error)
func (*MemoryStore) IsGranted ¶
func (s *MemoryStore) IsGranted(_ context.Context, req CheckRequest) (bool, []string, error)
func (*MemoryStore) List ¶
func (s *MemoryStore) List(_ context.Context, req ListRequest) ([]Record, error)
func (*MemoryStore) Revoke ¶
func (s *MemoryStore) Revoke(_ context.Context, req RevokeRequest) (Record, error)
func (*MemoryStore) State ¶
func (s *MemoryStore) State() MemoryState
type Record ¶
type Record struct {
PluginInstanceID string `json:"plugin_instance_id"`
PermissionID string `json:"permission_id"`
Effect Effect `json:"effect"`
GrantedBy string `json:"granted_by,omitempty"`
GrantedAt time.Time `json:"granted_at"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
RevokedAt *time.Time `json:"revoked_at,omitempty"`
RevokedBy string `json:"revoked_by,omitempty"`
RevokedReason string `json:"revoked_reason,omitempty"`
}
type RevokeRequest ¶
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
func NewSQLiteStore ¶
func NewSQLiteStore(ctx context.Context, path string) (*SQLiteStore, error)
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
func (*SQLiteStore) DeletePluginGrants ¶
func (s *SQLiteStore) DeletePluginGrants(ctx context.Context, pluginInstanceID string) error
func (*SQLiteStore) Grant ¶
func (s *SQLiteStore) Grant(ctx context.Context, req GrantRequest) (Record, error)
func (*SQLiteStore) IsGranted ¶
func (s *SQLiteStore) IsGranted(ctx context.Context, req CheckRequest) (bool, []string, error)
func (*SQLiteStore) List ¶
func (s *SQLiteStore) List(ctx context.Context, req ListRequest) ([]Record, error)
func (*SQLiteStore) Revoke ¶
func (s *SQLiteStore) Revoke(ctx context.Context, req RevokeRequest) (Record, error)
type Store ¶
type Store interface {
Grant(ctx context.Context, req GrantRequest) (Record, error)
Revoke(ctx context.Context, req RevokeRequest) (Record, error)
List(ctx context.Context, req ListRequest) ([]Record, error)
IsGranted(ctx context.Context, req CheckRequest) (bool, []string, error)
DeletePluginGrants(ctx context.Context, pluginInstanceID string) error
}
Click to show internal directories.
Click to hide internal directories.