Documentation
¶
Index ¶
- type AccountResource
- func (r *AccountResource) AddAuthMethod(ctx context.Context, req *s4wave_account.AddAuthMethodRequest) (*s4wave_account.AddAuthMethodResponse, error)
- func (r *AccountResource) ChangePassword(ctx context.Context, req *s4wave_account.ChangePasswordRequest) (*s4wave_account.ChangePasswordResponse, error)
- func (r *AccountResource) GenerateBackupKey(ctx context.Context, req *s4wave_account.GenerateBackupKeyRequest) (*s4wave_account.GenerateBackupKeyResponse, error)
- func (r *AccountResource) GetMux() srpc.Invoker
- func (r *AccountResource) LinkSSO(ctx context.Context, req *s4wave_account.LinkSSORequest) (*s4wave_account.LinkSSOResponse, error)
- func (r *AccountResource) LockAllEntityKeypairs(ctx context.Context, _ *s4wave_account.LockAllEntityKeypairsRequest) (*s4wave_account.LockAllEntityKeypairsResponse, error)
- func (r *AccountResource) LockEntityKeypair(ctx context.Context, req *s4wave_account.LockEntityKeypairRequest) (*s4wave_account.LockEntityKeypairResponse, error)
- func (r *AccountResource) PasskeyRegisterOptions(ctx context.Context, req *s4wave_account.PasskeyRegisterOptionsRequest) (*s4wave_account.PasskeyRegisterOptionsResponse, error)
- func (r *AccountResource) PasskeyRegisterVerify(ctx context.Context, req *s4wave_account.PasskeyRegisterVerifyRequest) (*s4wave_account.PasskeyRegisterVerifyResponse, error)
- func (r *AccountResource) Release()
- func (r *AccountResource) RemoveAuthMethod(ctx context.Context, req *s4wave_account.RemoveAuthMethodRequest) (*s4wave_account.RemoveAuthMethodResponse, error)
- func (r *AccountResource) ReplaceKeybindingOverrideSet(ctx context.Context, req *s4wave_account.ReplaceKeybindingOverrideSetRequest) (*s4wave_account.ReplaceKeybindingOverrideSetResponse, error)
- func (r *AccountResource) ResolveEntityKey(ctx context.Context, cred *session.EntityCredential) (bifrost_crypto.PrivKey, peer.ID, error)
- func (r *AccountResource) RevokeSession(ctx context.Context, req *s4wave_account.RevokeSessionRequest) (*s4wave_account.RevokeSessionResponse, error)
- func (r *AccountResource) SSOCodeExchange(ctx context.Context, req *s4wave_account.SSOCodeExchangeRequest) (*s4wave_account.SSOCodeExchangeResponse, error)
- func (r *AccountResource) SetSecurityLevel(ctx context.Context, req *s4wave_account.SetSecurityLevelRequest) (*s4wave_account.SetSecurityLevelResponse, error)
- func (r *AccountResource) SignWithEntityKeypair(ctx context.Context, req *s4wave_account.SignWithEntityKeypairRequest) (*s4wave_account.SignWithEntityKeypairResponse, error)
- func (r *AccountResource) StartDesktopPasskeyRegister(ctx context.Context, req *s4wave_account.StartDesktopPasskeyRegisterRequest) (*s4wave_account.StartDesktopPasskeyRegisterResponse, error)
- func (r *AccountResource) StartDesktopPasskeyRegisterHandoff(ctx context.Context, ...) (*s4wave_account.StartDesktopPasskeyRegisterHandoffResponse, error)
- func (r *AccountResource) UnlockEntityKeypair(ctx context.Context, req *s4wave_account.UnlockEntityKeypairRequest) (*s4wave_account.UnlockEntityKeypairResponse, error)
- func (r *AccountResource) WatchAccountInfo(req *s4wave_account.WatchAccountInfoRequest, ...) error
- func (r *AccountResource) WatchAuthMethods(req *s4wave_account.WatchAuthMethodsRequest, ...) error
- func (r *AccountResource) WatchEntityKeypairs(req *s4wave_account.WatchEntityKeypairsRequest, ...) error
- func (r *AccountResource) WatchKeybindingOverrides(req *s4wave_account.WatchKeybindingOverridesRequest, ...) error
- func (r *AccountResource) WatchSessions(req *s4wave_account.WatchSessionsRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountResource ¶
type AccountResource struct {
// contains filtered or unexported fields
}
AccountResource wraps a provider account for resource access.
func NewAccountResource ¶
func NewAccountResource(acc provider.ProviderAccount) *AccountResource
NewAccountResource creates a new AccountResource.
func (*AccountResource) AddAuthMethod ¶
func (r *AccountResource) AddAuthMethod( ctx context.Context, req *s4wave_account.AddAuthMethodRequest, ) (*s4wave_account.AddAuthMethodResponse, error)
AddAuthMethod adds a new entity keypair (auth method) to the account.
func (*AccountResource) ChangePassword ¶
func (r *AccountResource) ChangePassword( ctx context.Context, req *s4wave_account.ChangePasswordRequest, ) (*s4wave_account.ChangePasswordResponse, error)
ChangePassword changes the account password by deriving a new entity keypair from the new password, registering it, and removing the old one.
func (*AccountResource) GenerateBackupKey ¶
func (r *AccountResource) GenerateBackupKey( ctx context.Context, req *s4wave_account.GenerateBackupKeyRequest, ) (*s4wave_account.GenerateBackupKeyResponse, error)
GenerateBackupKey generates an Ed25519 backup keypair, registers the public key with the account, and returns the private key PEM for the user to store safely.
func (*AccountResource) GetMux ¶
func (r *AccountResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*AccountResource) LinkSSO ¶
func (r *AccountResource) LinkSSO( ctx context.Context, req *s4wave_account.LinkSSORequest, ) (*s4wave_account.LinkSSOResponse, error)
LinkSSO generates a custodied keypair, wraps with optional PIN, and registers it with the cloud via multi-sig.
func (*AccountResource) LockAllEntityKeypairs ¶
func (r *AccountResource) LockAllEntityKeypairs( ctx context.Context, _ *s4wave_account.LockAllEntityKeypairsRequest, ) (*s4wave_account.LockAllEntityKeypairsResponse, error)
LockAllEntityKeypairs drops all unlocked entity private keys.
func (*AccountResource) LockEntityKeypair ¶
func (r *AccountResource) LockEntityKeypair( ctx context.Context, req *s4wave_account.LockEntityKeypairRequest, ) (*s4wave_account.LockEntityKeypairResponse, error)
LockEntityKeypair drops a previously unlocked entity private key.
func (*AccountResource) PasskeyRegisterOptions ¶
func (r *AccountResource) PasskeyRegisterOptions( ctx context.Context, req *s4wave_account.PasskeyRegisterOptionsRequest, ) (*s4wave_account.PasskeyRegisterOptionsResponse, error)
PasskeyRegisterOptions fetches WebAuthn registration options from the cloud.
func (*AccountResource) PasskeyRegisterVerify ¶
func (r *AccountResource) PasskeyRegisterVerify( ctx context.Context, req *s4wave_account.PasskeyRegisterVerifyRequest, ) (*s4wave_account.PasskeyRegisterVerifyResponse, error)
PasskeyRegisterVerify verifies a WebAuthn registration credential and registers the passkey with the cloud.
func (*AccountResource) Release ¶
func (r *AccountResource) Release()
Release releases any account-resource-scoped step-up retention.
func (*AccountResource) RemoveAuthMethod ¶
func (r *AccountResource) RemoveAuthMethod( ctx context.Context, req *s4wave_account.RemoveAuthMethodRequest, ) (*s4wave_account.RemoveAuthMethodResponse, error)
RemoveAuthMethod removes an entity keypair from the account.
func (*AccountResource) ReplaceKeybindingOverrideSet ¶ added in v0.57.2
func (r *AccountResource) ReplaceKeybindingOverrideSet( ctx context.Context, req *s4wave_account.ReplaceKeybindingOverrideSetRequest, ) (*s4wave_account.ReplaceKeybindingOverrideSetResponse, error)
ReplaceKeybindingOverrideSet atomically applies a complete account layer replacement.
func (*AccountResource) ResolveEntityKey ¶
func (r *AccountResource) ResolveEntityKey(ctx context.Context, cred *session.EntityCredential) (bifrost_crypto.PrivKey, peer.ID, error)
ResolveEntityKey resolves the entity private key from an EntityCredential.
func (*AccountResource) RevokeSession ¶
func (r *AccountResource) RevokeSession( ctx context.Context, req *s4wave_account.RevokeSessionRequest, ) (*s4wave_account.RevokeSessionResponse, error)
RevokeSession revokes a session by peer ID.
When credential is nil and the requested session_peer_id matches the current session, uses the session self-revoke endpoint (no entity key needed). Otherwise falls through to the entity multi-sig path, with key-store fallback.
func (*AccountResource) SSOCodeExchange ¶
func (r *AccountResource) SSOCodeExchange( ctx context.Context, req *s4wave_account.SSOCodeExchangeRequest, ) (*s4wave_account.SSOCodeExchangeResponse, error)
SSOCodeExchange exchanges an OAuth authorization code for account info.
func (*AccountResource) SetSecurityLevel ¶
func (r *AccountResource) SetSecurityLevel( ctx context.Context, req *s4wave_account.SetSecurityLevelRequest, ) (*s4wave_account.SetSecurityLevelResponse, error)
SetSecurityLevel updates the auth threshold for the account.
func (*AccountResource) SignWithEntityKeypair ¶ added in v0.54.0
func (r *AccountResource) SignWithEntityKeypair( ctx context.Context, req *s4wave_account.SignWithEntityKeypairRequest, ) (*s4wave_account.SignWithEntityKeypairResponse, error)
SignWithEntityKeypair signs an arbitrary payload with an unlocked entity keypair.
func (*AccountResource) StartDesktopPasskeyRegister ¶
func (r *AccountResource) StartDesktopPasskeyRegister( ctx context.Context, req *s4wave_account.StartDesktopPasskeyRegisterRequest, ) (*s4wave_account.StartDesktopPasskeyRegisterResponse, error)
StartDesktopPasskeyRegister starts the desktop add-passkey flow.
func (*AccountResource) StartDesktopPasskeyRegisterHandoff ¶
func (r *AccountResource) StartDesktopPasskeyRegisterHandoff( ctx context.Context, req *s4wave_account.StartDesktopPasskeyRegisterHandoffRequest, ) (*s4wave_account.StartDesktopPasskeyRegisterHandoffResponse, error)
StartDesktopPasskeyRegisterHandoff runs the native desktop add-passkey browser handoff and returns the browser-collected register artifacts.
func (*AccountResource) UnlockEntityKeypair ¶
func (r *AccountResource) UnlockEntityKeypair( ctx context.Context, req *s4wave_account.UnlockEntityKeypairRequest, ) (*s4wave_account.UnlockEntityKeypairResponse, error)
UnlockEntityKeypair derives the entity private key from a credential and holds it in memory for signing operations.
func (*AccountResource) WatchAccountInfo ¶
func (r *AccountResource) WatchAccountInfo( req *s4wave_account.WatchAccountInfoRequest, strm s4wave_account.SRPCAccountResourceService_WatchAccountInfoStream, ) error
WatchAccountInfo streams information about this account.
func (*AccountResource) WatchAuthMethods ¶
func (r *AccountResource) WatchAuthMethods( req *s4wave_account.WatchAuthMethodsRequest, strm s4wave_account.SRPCAccountResourceService_WatchAuthMethodsStream, ) error
WatchAuthMethods streams the account auth-method rows for this account.
func (*AccountResource) WatchEntityKeypairs ¶
func (r *AccountResource) WatchEntityKeypairs( req *s4wave_account.WatchEntityKeypairsRequest, strm s4wave_account.SRPCAccountResourceService_WatchEntityKeypairsStream, ) error
WatchEntityKeypairs streams entity keypairs with their lock state.
Account state and key-store unlock state are folded into one local broadcast so the watch loop reads both inputs under the same HoldLock that obtains the wait channel. This eliminates the missed-wakeup race that the previous dual-channel select had to defend against and coalesces near-simultaneous changes (e.g. an account-state update landing alongside a key-store unlock) into a single emission instead of one per source.
func (*AccountResource) WatchKeybindingOverrides ¶ added in v0.53.0
func (r *AccountResource) WatchKeybindingOverrides( req *s4wave_account.WatchKeybindingOverridesRequest, strm s4wave_account.SRPCAccountResourceService_WatchKeybindingOverridesStream, ) error
WatchKeybindingOverrides streams account-scope keybinding overrides.
func (*AccountResource) WatchSessions ¶
func (r *AccountResource) WatchSessions( req *s4wave_account.WatchSessionsRequest, strm s4wave_account.SRPCAccountResourceService_WatchSessionsStream, ) error
WatchSessions streams the attached sessions snapshot for this account.