Documentation
¶
Index ¶
- type FSAPIKeyStore
- func (s *FSAPIKeyStore) CreateAPIKey(ctx context.Context, req *core.CreateAPIKeyRequest) (*core.CreateAPIKeyResponse, error)
- func (s *FSAPIKeyStore) GetAPIKeyByID(ctx context.Context, req *core.GetAPIKeyByIDRequest) (*core.GetAPIKeyByIDResponse, error)
- func (s *FSAPIKeyStore) ListSubjectAPIKeys(ctx context.Context, req *core.ListSubjectAPIKeysRequest) (*core.ListSubjectAPIKeysResponse, error)
- func (s *FSAPIKeyStore) RevokeAPIKey(ctx context.Context, req *core.RevokeAPIKeyRequest) (*core.RevokeAPIKeyResponse, error)
- func (s *FSAPIKeyStore) UpdateAPIKeyLastUsed(ctx context.Context, req *core.UpdateAPIKeyLastUsedRequest) (*core.UpdateAPIKeyLastUsedResponse, error)
- func (s *FSAPIKeyStore) ValidateAPIKey(ctx context.Context, req *core.ValidateAPIKeyRequest) (*core.ValidateAPIKeyResponse, error)
- type FSAppStore
- func (s *FSAppStore) DeleteApp(ctx context.Context, req *core.DeleteAppRequest) (*core.DeleteAppResponse, error)
- func (s *FSAppStore) GetApp(ctx context.Context, req *core.GetAppRequest) (*core.GetAppResponse, error)
- func (s *FSAppStore) ListApps(ctx context.Context, req *core.ListAppsRequest) (*core.ListAppsResponse, error)
- func (s *FSAppStore) SaveApp(ctx context.Context, req *core.SaveAppRequest) (*core.SaveAppResponse, error)
- type FSChannelStore
- func (s *FSChannelStore) GetChannel(ctx context.Context, req *accounts.GetChannelRequest) (*accounts.GetChannelResponse, error)
- func (s *FSChannelStore) GetChannelsByIdentity(ctx context.Context, req *accounts.GetChannelsByIdentityRequest) (*accounts.GetChannelsByIdentityResponse, error)
- func (s *FSChannelStore) SaveChannel(ctx context.Context, req *accounts.SaveChannelRequest) (*accounts.SaveChannelResponse, error)
- type FSIdentityStore
- func (s *FSIdentityStore) GetIdentity(ctx context.Context, req *accounts.GetIdentityRequest) (*accounts.GetIdentityResponse, error)
- func (s *FSIdentityStore) GetUserIdentities(ctx context.Context, req *accounts.GetUserIdentitiesRequest) (*accounts.GetUserIdentitiesResponse, error)
- func (s *FSIdentityStore) MarkIdentityVerified(ctx context.Context, req *accounts.MarkIdentityVerifiedRequest) (*accounts.MarkIdentityVerifiedResponse, error)
- func (s *FSIdentityStore) SaveIdentity(ctx context.Context, req *accounts.SaveIdentityRequest) (*accounts.SaveIdentityResponse, error)
- func (s *FSIdentityStore) SetUserForIdentity(ctx context.Context, req *accounts.SetUserForIdentityRequest) (*accounts.SetUserForIdentityResponse, error)
- type FSKeyStore
- func (s *FSKeyStore) DeleteKey(ctx context.Context, req *keys.DeleteKeyRequest) (*keys.DeleteKeyResponse, error)
- func (s *FSKeyStore) GetKey(ctx context.Context, req *keys.GetKeyRequest) (*keys.GetKeyResponse, error)
- func (s *FSKeyStore) GetKeyByKid(ctx context.Context, req *keys.GetKeyByKidRequest) (*keys.GetKeyByKidResponse, error)
- func (s *FSKeyStore) ListKeyIDs(ctx context.Context, req *keys.ListKeyIDsRequest) (*keys.ListKeyIDsResponse, error)
- func (s *FSKeyStore) PutKey(ctx context.Context, req *keys.PutKeyRequest) (*keys.PutKeyResponse, error)
- type FSKidStore
- func (s *FSKidStore) Add(ctx context.Context, req *keys.AddKidRequest) (*keys.AddKidResponse, error)
- func (s *FSKidStore) CleanExpired(ctx context.Context, req *keys.CleanExpiredRequest) (*keys.CleanExpiredResponse, error)
- func (s *FSKidStore) GetKey(ctx context.Context, req *keys.GetKeyRequest) (*keys.GetKeyResponse, error)
- func (s *FSKidStore) GetKeyByKid(ctx context.Context, req *keys.GetKeyByKidRequest) (*keys.GetKeyByKidResponse, error)
- func (s *FSKidStore) Remove(ctx context.Context, req *keys.RemoveKidRequest) (*keys.RemoveKidResponse, error)
- type FSRefreshTokenStore
- func (s *FSRefreshTokenStore) CleanupExpiredTokens(ctx context.Context, req *core.CleanupExpiredTokensRequest) (*core.CleanupExpiredTokensResponse, error)
- func (s *FSRefreshTokenStore) CreateRefreshToken(ctx context.Context, req *core.CreateRefreshTokenRequest) (*core.CreateRefreshTokenResponse, error)
- func (s *FSRefreshTokenStore) GetRefreshToken(ctx context.Context, req *core.GetRefreshTokenRequest) (*core.GetRefreshTokenResponse, error)
- func (s *FSRefreshTokenStore) GetSubjectTokens(ctx context.Context, req *core.GetSubjectTokensRequest) (*core.GetSubjectTokensResponse, error)
- func (s *FSRefreshTokenStore) RevokeRefreshToken(ctx context.Context, req *core.RevokeRefreshTokenRequest) (*core.RevokeRefreshTokenResponse, error)
- func (s *FSRefreshTokenStore) RevokeSubjectTokens(ctx context.Context, req *core.RevokeSubjectTokensRequest) (*core.RevokeSubjectTokensResponse, error)
- func (s *FSRefreshTokenStore) RevokeTokenFamily(ctx context.Context, req *core.RevokeTokenFamilyRequest) (*core.RevokeTokenFamilyResponse, error)
- func (s *FSRefreshTokenStore) RotateRefreshToken(ctx context.Context, req *core.RotateRefreshTokenRequest) (*core.RotateRefreshTokenResponse, error)
- type FSTokenStore
- func (s *FSTokenStore) CreateToken(ctx context.Context, req *localauth.CreateVerificationTokenRequest) (*localauth.CreateVerificationTokenResponse, error)
- func (s *FSTokenStore) DeleteSubjectTokens(ctx context.Context, req *localauth.DeleteSubjectVerificationTokensRequest) (*localauth.DeleteSubjectVerificationTokensResponse, error)
- func (s *FSTokenStore) DeleteToken(ctx context.Context, req *localauth.DeleteVerificationTokenRequest) (*localauth.DeleteVerificationTokenResponse, error)
- func (s *FSTokenStore) GetToken(ctx context.Context, req *localauth.GetVerificationTokenRequest) (*localauth.GetVerificationTokenResponse, error)
- type FSUser
- type FSUserStore
- func (s *FSUserStore) CreateUser(ctx context.Context, req *accounts.CreateUserRequest) (*accounts.CreateUserResponse, error)
- func (s *FSUserStore) GetUserById(ctx context.Context, req *accounts.GetUserByIDRequest) (*accounts.GetUserByIDResponse, error)
- func (s *FSUserStore) SaveUser(ctx context.Context, req *accounts.SaveUserRequest) (*accounts.SaveUserResponse, error)
- type FSUsername
- type FSUsernameStore
- func (s *FSUsernameStore) ChangeUsername(ctx context.Context, req *accounts.ChangeUsernameRequest) (*accounts.ChangeUsernameResponse, error)
- func (s *FSUsernameStore) GetUserByUsername(ctx context.Context, req *accounts.GetUserByUsernameRequest) (*accounts.GetUserByUsernameResponse, error)
- func (s *FSUsernameStore) ReleaseUsername(ctx context.Context, req *accounts.ReleaseUsernameRequest) (*accounts.ReleaseUsernameResponse, error)
- func (s *FSUsernameStore) ReserveUsername(ctx context.Context, req *accounts.ReserveUsernameRequest) (*accounts.ReserveUsernameResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSAPIKeyStore ¶
type FSAPIKeyStore struct {
StoragePath string
// contains filtered or unexported fields
}
FSAPIKeyStore stores API keys as JSON files
func NewFSAPIKeyStore ¶
func NewFSAPIKeyStore(storagePath string) *FSAPIKeyStore
NewFSAPIKeyStore creates a new file-based API key store
func (*FSAPIKeyStore) CreateAPIKey ¶
func (s *FSAPIKeyStore) CreateAPIKey(ctx context.Context, req *core.CreateAPIKeyRequest) (*core.CreateAPIKeyResponse, error)
func (*FSAPIKeyStore) GetAPIKeyByID ¶
func (s *FSAPIKeyStore) GetAPIKeyByID(ctx context.Context, req *core.GetAPIKeyByIDRequest) (*core.GetAPIKeyByIDResponse, error)
func (*FSAPIKeyStore) ListSubjectAPIKeys ¶ added in v0.1.3
func (s *FSAPIKeyStore) ListSubjectAPIKeys(ctx context.Context, req *core.ListSubjectAPIKeysRequest) (*core.ListSubjectAPIKeysResponse, error)
func (*FSAPIKeyStore) RevokeAPIKey ¶
func (s *FSAPIKeyStore) RevokeAPIKey(ctx context.Context, req *core.RevokeAPIKeyRequest) (*core.RevokeAPIKeyResponse, error)
func (*FSAPIKeyStore) UpdateAPIKeyLastUsed ¶
func (s *FSAPIKeyStore) UpdateAPIKeyLastUsed(ctx context.Context, req *core.UpdateAPIKeyLastUsedRequest) (*core.UpdateAPIKeyLastUsedResponse, error)
func (*FSAPIKeyStore) ValidateAPIKey ¶
func (s *FSAPIKeyStore) ValidateAPIKey(ctx context.Context, req *core.ValidateAPIKeyRequest) (*core.ValidateAPIKeyResponse, error)
type FSAppStore ¶ added in v0.0.81
type FSAppStore struct {
StoragePath string
// contains filtered or unexported fields
}
FSAppStore implements core.AppRegistrationStore by persisting each registration as a JSON file under {basePath}/apps/{client_id}.json.
Mirrors the FSKeyStore design: file-per-record (so concurrent ops don't serialize on a single mutex outside this process), atomic writes via temp-file + rename (so a crash mid-write leaves either the old file or the new file intact, never a half-written one), and safeName guarding path-traversal in client_ids.
In-process concurrency is mediated by sync.RWMutex. Multi-process deployments need a backend with real transaction semantics — see GORMAppStore (#167).
func NewFSAppStore ¶ added in v0.0.81
func NewFSAppStore(storagePath string) *FSAppStore
NewFSAppStore creates a filesystem-backed AppRegistrationStore. The {basePath}/apps/ directory is created lazily on first write.
func (*FSAppStore) DeleteApp ¶ added in v0.0.81
func (s *FSAppStore) DeleteApp(ctx context.Context, req *core.DeleteAppRequest) (*core.DeleteAppResponse, error)
DeleteApp removes the registration for req.ClientID. Returns core.ErrAppNotFound if no such registration exists, matching InMemoryAppStore semantics.
func (*FSAppStore) GetApp ¶ added in v0.0.81
func (s *FSAppStore) GetApp(ctx context.Context, req *core.GetAppRequest) (*core.GetAppResponse, error)
GetApp returns the registration for req.ClientID, or core.ErrAppNotFound if no such file exists. A corrupt JSON file surfaces as a parse error rather than ErrAppNotFound — callers should distinguish "registration absent" from "registration unreadable" so an unexpected on-disk corruption isn't silently treated as a missing client.
func (*FSAppStore) ListApps ¶ added in v0.0.81
func (s *FSAppStore) ListApps(ctx context.Context, req *core.ListAppsRequest) (*core.ListAppsResponse, error)
ListApps returns every registration in the store. Files that fail to parse are skipped (with no error returned) so a single hand-corrupted file does not lock out admin tooling — partial recovery beats total failure here. Callers needing strict integrity should validate at the store level (e.g., periodic fsck) rather than relying on ListApps.
Returns an empty slice (not an error) when the apps dir does not yet exist, matching the InMemory backend's "fresh store has no apps" shape.
func (*FSAppStore) SaveApp ¶ added in v0.0.81
func (s *FSAppStore) SaveApp(ctx context.Context, req *core.SaveAppRequest) (*core.SaveAppResponse, error)
SaveApp persists req.App to disk. Overwrites any existing registration with the same client_id. Empty client_id is rejected.
type FSChannelStore ¶
type FSChannelStore struct {
StoragePath string
}
FSChannelStore stores channels as JSON files
func NewFSChannelStore ¶
func NewFSChannelStore(storagePath string) *FSChannelStore
func (*FSChannelStore) GetChannel ¶
func (s *FSChannelStore) GetChannel(ctx context.Context, req *accounts.GetChannelRequest) (*accounts.GetChannelResponse, error)
func (*FSChannelStore) GetChannelsByIdentity ¶
func (s *FSChannelStore) GetChannelsByIdentity(ctx context.Context, req *accounts.GetChannelsByIdentityRequest) (*accounts.GetChannelsByIdentityResponse, error)
func (*FSChannelStore) SaveChannel ¶
func (s *FSChannelStore) SaveChannel(ctx context.Context, req *accounts.SaveChannelRequest) (*accounts.SaveChannelResponse, error)
type FSIdentityStore ¶
type FSIdentityStore struct {
StoragePath string
}
FSIdentityStore stores identities as JSON files
func NewFSIdentityStore ¶
func NewFSIdentityStore(storagePath string) *FSIdentityStore
func (*FSIdentityStore) GetIdentity ¶
func (s *FSIdentityStore) GetIdentity(ctx context.Context, req *accounts.GetIdentityRequest) (*accounts.GetIdentityResponse, error)
func (*FSIdentityStore) GetUserIdentities ¶
func (s *FSIdentityStore) GetUserIdentities(ctx context.Context, req *accounts.GetUserIdentitiesRequest) (*accounts.GetUserIdentitiesResponse, error)
func (*FSIdentityStore) MarkIdentityVerified ¶
func (s *FSIdentityStore) MarkIdentityVerified(ctx context.Context, req *accounts.MarkIdentityVerifiedRequest) (*accounts.MarkIdentityVerifiedResponse, error)
func (*FSIdentityStore) SaveIdentity ¶
func (s *FSIdentityStore) SaveIdentity(ctx context.Context, req *accounts.SaveIdentityRequest) (*accounts.SaveIdentityResponse, error)
func (*FSIdentityStore) SetUserForIdentity ¶
func (s *FSIdentityStore) SetUserForIdentity(ctx context.Context, req *accounts.SetUserForIdentityRequest) (*accounts.SetUserForIdentityResponse, error)
type FSKeyStore ¶ added in v0.0.32
type FSKeyStore struct {
StoragePath string
// contains filtered or unexported fields
}
FSKeyStore implements keys.KeyStorage using filesystem storage.
func NewFSKeyStore ¶ added in v0.0.32
func NewFSKeyStore(storagePath string) *FSKeyStore
NewFSKeyStore creates a new filesystem-backed KeyStore.
func (*FSKeyStore) DeleteKey ¶ added in v0.0.32
func (s *FSKeyStore) DeleteKey(ctx context.Context, req *keys.DeleteKeyRequest) (*keys.DeleteKeyResponse, error)
func (*FSKeyStore) GetKey ¶ added in v0.0.38
func (s *FSKeyStore) GetKey(ctx context.Context, req *keys.GetKeyRequest) (*keys.GetKeyResponse, error)
func (*FSKeyStore) GetKeyByKid ¶ added in v0.0.38
func (s *FSKeyStore) GetKeyByKid(ctx context.Context, req *keys.GetKeyByKidRequest) (*keys.GetKeyByKidResponse, error)
func (*FSKeyStore) ListKeyIDs ¶ added in v0.0.38
func (s *FSKeyStore) ListKeyIDs(ctx context.Context, req *keys.ListKeyIDsRequest) (*keys.ListKeyIDsResponse, error)
func (*FSKeyStore) PutKey ¶ added in v0.0.38
func (s *FSKeyStore) PutKey(ctx context.Context, req *keys.PutKeyRequest) (*keys.PutKeyResponse, error)
type FSKidStore ¶ added in v0.0.83
type FSKidStore struct {
StoragePath string
// contains filtered or unexported fields
}
FSKidStore implements keys.KidStorage using filesystem storage.
func NewFSKidStore ¶ added in v0.0.83
func NewFSKidStore(storagePath string) *FSKidStore
NewFSKidStore creates a new filesystem-backed KidStorage.
func (*FSKidStore) Add ¶ added in v0.0.83
func (s *FSKidStore) Add(ctx context.Context, req *keys.AddKidRequest) (*keys.AddKidResponse, error)
func (*FSKidStore) CleanExpired ¶ added in v0.0.83
func (s *FSKidStore) CleanExpired(ctx context.Context, req *keys.CleanExpiredRequest) (*keys.CleanExpiredResponse, error)
func (*FSKidStore) GetKey ¶ added in v0.0.83
func (s *FSKidStore) GetKey(ctx context.Context, req *keys.GetKeyRequest) (*keys.GetKeyResponse, error)
func (*FSKidStore) GetKeyByKid ¶ added in v0.0.83
func (s *FSKidStore) GetKeyByKid(ctx context.Context, req *keys.GetKeyByKidRequest) (*keys.GetKeyByKidResponse, error)
func (*FSKidStore) Remove ¶ added in v0.0.83
func (s *FSKidStore) Remove(ctx context.Context, req *keys.RemoveKidRequest) (*keys.RemoveKidResponse, error)
type FSRefreshTokenStore ¶
type FSRefreshTokenStore struct {
StoragePath string
// contains filtered or unexported fields
}
FSRefreshTokenStore stores refresh tokens as JSON files
func NewFSRefreshTokenStore ¶
func NewFSRefreshTokenStore(storagePath string) *FSRefreshTokenStore
NewFSRefreshTokenStore creates a new file-based refresh token store
func (*FSRefreshTokenStore) CleanupExpiredTokens ¶
func (s *FSRefreshTokenStore) CleanupExpiredTokens(ctx context.Context, req *core.CleanupExpiredTokensRequest) (*core.CleanupExpiredTokensResponse, error)
func (*FSRefreshTokenStore) CreateRefreshToken ¶
func (s *FSRefreshTokenStore) CreateRefreshToken(ctx context.Context, req *core.CreateRefreshTokenRequest) (*core.CreateRefreshTokenResponse, error)
func (*FSRefreshTokenStore) GetRefreshToken ¶
func (s *FSRefreshTokenStore) GetRefreshToken(ctx context.Context, req *core.GetRefreshTokenRequest) (*core.GetRefreshTokenResponse, error)
func (*FSRefreshTokenStore) GetSubjectTokens ¶ added in v0.1.3
func (s *FSRefreshTokenStore) GetSubjectTokens(ctx context.Context, req *core.GetSubjectTokensRequest) (*core.GetSubjectTokensResponse, error)
func (*FSRefreshTokenStore) RevokeRefreshToken ¶
func (s *FSRefreshTokenStore) RevokeRefreshToken(ctx context.Context, req *core.RevokeRefreshTokenRequest) (*core.RevokeRefreshTokenResponse, error)
func (*FSRefreshTokenStore) RevokeSubjectTokens ¶ added in v0.1.3
func (s *FSRefreshTokenStore) RevokeSubjectTokens(ctx context.Context, req *core.RevokeSubjectTokensRequest) (*core.RevokeSubjectTokensResponse, error)
func (*FSRefreshTokenStore) RevokeTokenFamily ¶
func (s *FSRefreshTokenStore) RevokeTokenFamily(ctx context.Context, req *core.RevokeTokenFamilyRequest) (*core.RevokeTokenFamilyResponse, error)
func (*FSRefreshTokenStore) RotateRefreshToken ¶
func (s *FSRefreshTokenStore) RotateRefreshToken(ctx context.Context, req *core.RotateRefreshTokenRequest) (*core.RotateRefreshTokenResponse, error)
type FSTokenStore ¶
type FSTokenStore struct {
StoragePath string
}
FSTokenStore stores localauth verification and reset tokens as JSON files. Satisfies localauth.VerificationTokenStore.
func NewFSTokenStore ¶
func NewFSTokenStore(storagePath string) *FSTokenStore
func (*FSTokenStore) CreateToken ¶
func (s *FSTokenStore) CreateToken(ctx context.Context, req *localauth.CreateVerificationTokenRequest) (*localauth.CreateVerificationTokenResponse, error)
func (*FSTokenStore) DeleteSubjectTokens ¶ added in v0.1.3
func (s *FSTokenStore) DeleteSubjectTokens(ctx context.Context, req *localauth.DeleteSubjectVerificationTokensRequest) (*localauth.DeleteSubjectVerificationTokensResponse, error)
func (*FSTokenStore) DeleteToken ¶
func (s *FSTokenStore) DeleteToken(ctx context.Context, req *localauth.DeleteVerificationTokenRequest) (*localauth.DeleteVerificationTokenResponse, error)
func (*FSTokenStore) GetToken ¶
func (s *FSTokenStore) GetToken(ctx context.Context, req *localauth.GetVerificationTokenRequest) (*localauth.GetVerificationTokenResponse, error)
type FSUser ¶
type FSUser struct {
UserId string `json:"user_id"`
IsActive bool `json:"is_active"`
UserProfile map[string]any `json:"profile"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
FSUser implements the accounts.User interface
type FSUserStore ¶
type FSUserStore struct {
StoragePath string
}
FSUserStore stores users as JSON files
func NewFSUserStore ¶
func NewFSUserStore(storagePath string) *FSUserStore
func (*FSUserStore) CreateUser ¶
func (s *FSUserStore) CreateUser(ctx context.Context, req *accounts.CreateUserRequest) (*accounts.CreateUserResponse, error)
func (*FSUserStore) GetUserById ¶
func (s *FSUserStore) GetUserById(ctx context.Context, req *accounts.GetUserByIDRequest) (*accounts.GetUserByIDResponse, error)
func (*FSUserStore) SaveUser ¶
func (s *FSUserStore) SaveUser(ctx context.Context, req *accounts.SaveUserRequest) (*accounts.SaveUserResponse, error)
type FSUsername ¶ added in v0.0.26
type FSUsername struct {
NormalizedUsername string `json:"normalized_username"`
Username string `json:"username"`
UserID string `json:"user_id"`
Version int `json:"version"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
FSUsername represents a username reservation stored as JSON
type FSUsernameStore ¶ added in v0.0.26
type FSUsernameStore struct {
StoragePath string
}
FSUsernameStore implements accounts.UsernameStore using filesystem storage.
func NewFSUsernameStore ¶ added in v0.0.26
func NewFSUsernameStore(storagePath string) *FSUsernameStore
func (*FSUsernameStore) ChangeUsername ¶ added in v0.0.26
func (s *FSUsernameStore) ChangeUsername(ctx context.Context, req *accounts.ChangeUsernameRequest) (*accounts.ChangeUsernameResponse, error)
func (*FSUsernameStore) GetUserByUsername ¶ added in v0.0.26
func (s *FSUsernameStore) GetUserByUsername(ctx context.Context, req *accounts.GetUserByUsernameRequest) (*accounts.GetUserByUsernameResponse, error)
func (*FSUsernameStore) ReleaseUsername ¶ added in v0.0.26
func (s *FSUsernameStore) ReleaseUsername(ctx context.Context, req *accounts.ReleaseUsernameRequest) (*accounts.ReleaseUsernameResponse, error)
func (*FSUsernameStore) ReserveUsername ¶ added in v0.0.26
func (s *FSUsernameStore) ReserveUsername(ctx context.Context, req *accounts.ReserveUsernameRequest) (*accounts.ReserveUsernameResponse, error)