resource_account

package
v0.51.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

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

AddAuthMethod adds a new entity keypair (auth method) to the account.

func (*AccountResource) ChangePassword

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

GenerateBackupKey generates an Ed25519 backup keypair, registers the public key with the cloud as a "pem" auth method, and returns the private key PEM for the user to download and store safely.

func (*AccountResource) GetMux

func (r *AccountResource) GetMux() srpc.Invoker

GetMux returns the rpc mux.

func (*AccountResource) LinkSSO

LinkSSO generates a custodied keypair, wraps with optional PIN, and registers it with the cloud via multi-sig.

func (*AccountResource) LockAllEntityKeypairs

LockAllEntityKeypairs drops all unlocked entity private keys.

func (*AccountResource) LockEntityKeypair

LockEntityKeypair drops a previously unlocked entity private key.

func (*AccountResource) PasskeyRegisterOptions

PasskeyRegisterOptions fetches WebAuthn registration options from the cloud.

func (*AccountResource) PasskeyRegisterVerify

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

RemoveAuthMethod removes an entity keypair from the account.

func (*AccountResource) ResolveEntityKey

ResolveEntityKey resolves the entity private key from an EntityCredential.

func (*AccountResource) RevokeSession

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 tracker fallback.

func (*AccountResource) SSOCodeExchange

SSOCodeExchange exchanges an OAuth authorization code for account info.

func (*AccountResource) SetSecurityLevel

SetSecurityLevel updates the auth threshold for the account.

func (*AccountResource) StartDesktopPasskeyRegister

StartDesktopPasskeyRegister starts the desktop add-passkey flow.

func (*AccountResource) StartDesktopPasskeyRegisterHandoff

StartDesktopPasskeyRegisterHandoff runs the native desktop add-passkey browser handoff and returns the browser-collected register artifacts.

func (*AccountResource) UnlockEntityKeypair

UnlockEntityKeypair derives the entity private key from a credential and holds it in memory for signing operations.

func (*AccountResource) WatchAccountInfo

WatchAccountInfo streams information about this account.

func (*AccountResource) WatchAuthMethods

WatchAuthMethods streams the account auth-method rows for this account.

func (*AccountResource) WatchEntityKeypairs

WatchEntityKeypairs streams entity keypairs with their lock state.

Account state and tracker 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 tracker unlock) into a single emission instead of one per source.

func (*AccountResource) WatchSessions

WatchSessions streams the attached sessions snapshot for this account.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL