Documentation
¶
Overview ¶
Package adminclient is the /_admin/... side of backd's HTTP API, as an add-on to the Go client: adminclient.New takes a configured *client.Client and reuses its address, realm, credentials, transport, retries and error mapping through client.Do. It is internal on purpose: a shipped program must not be able to administer a realm, so the public client leaves administration out and only backd's own tools (the CLI) build on this. If the admin API is ever made public this package moves to pkg/admin with the same shape.
Methods are named for what they do and take the pieces of the request (ids, a query, a body); answers are decoded into out (a pointer, or nil). Every method takes request options last (client.WithHeader for the proof of identity of a sensitive action, client.WithIfMatch, …).
Index ¶
- type APIKeys
- type Admin
- type AppConfig
- func (x *AppConfig) Get(ctx context.Context, out any, opts ...Opt) (http.Header, error)
- func (x *AppConfig) History(ctx context.Context, q url.Values, out any, opts ...Opt) error
- func (x *AppConfig) Patch(ctx context.Context, version string, body, out any, opts ...Opt) error
- func (x *AppConfig) Rollback(ctx context.Context, version string, body, out any, opts ...Opt) error
- type Audit
- type Compliance
- type Consents
- type Data
- type DataChecks
- type DataMigrations
- type Encryption
- type Export
- type Files
- type Functions
- func (x *Functions) Control(ctx context.Context, database, name, op string, out any, opts ...Opt) error
- func (x *Functions) Invocations(ctx context.Context, q url.Values, out any, opts ...Opt) error
- func (x *Functions) Invoke(ctx context.Context, database, name string, body, out any, opts ...Opt) (http.Header, error)
- func (x *Functions) Schedules(ctx context.Context, out any, opts ...Opt) error
- type Import
- type Jobs
- type MFA
- type Opt
- type Opts
- type Orgs
- func (x *Orgs) AddMember(ctx context.Context, id string, body any, opts ...Opt) error
- func (x *Orgs) Create(ctx context.Context, body, out any, opts ...Opt) error
- func (x *Orgs) Delete(ctx context.Context, id string, opts ...Opt) error
- func (x *Orgs) Get(ctx context.Context, id string, out any, opts ...Opt) error
- func (x *Orgs) Invitations(ctx context.Context, id string, out any, opts ...Opt) error
- func (x *Orgs) Invite(ctx context.Context, id string, body, out any, opts ...Opt) error
- func (x *Orgs) List(ctx context.Context, q url.Values, out any, opts ...Opt) error
- func (x *Orgs) Members(ctx context.Context, id string, q url.Values, out any, opts ...Opt) error
- func (x *Orgs) Owned(ctx context.Context, id string, out any, opts ...Opt) error
- func (x *Orgs) Patch(ctx context.Context, id string, body, out any, opts ...Opt) error
- func (x *Orgs) Reactivate(ctx context.Context, id string, body any, opts ...Opt) error
- func (x *Orgs) RevokeInvitation(ctx context.Context, id, invitation string, opts ...Opt) error
- func (x *Orgs) SSODelete(ctx context.Context, id, provider string, opts ...Opt) error
- func (x *Orgs) SSOList(ctx context.Context, id string, out any, opts ...Opt) error
- func (x *Orgs) SSOSet(ctx context.Context, id, provider string, body, out any, opts ...Opt) error
- func (x *Orgs) SetClaims(ctx context.Context, id string, claims any, opts ...Opt) error
- func (x *Orgs) SetOwner(ctx context.Context, id string, body any, opts ...Opt) error
- func (x *Orgs) SetSlug(ctx context.Context, id string, body, out any, opts ...Opt) error
- type Passwords
- type Push
- func (x *Push) DeleteDevices(ctx context.Context, q url.Values, out any, opts ...Opt) error
- func (x *Push) Send(ctx context.Context, id string, out any, opts ...Opt) error
- func (x *Push) Sends(ctx context.Context, q url.Values, out any, opts ...Opt) error
- func (x *Push) Test(ctx context.Context, body, out any, opts ...Opt) error
- type Secrets
- func (x *Secrets) Create(ctx context.Context, body, out any, opts ...Opt) error
- func (x *Secrets) Delete(ctx context.Context, name string, q url.Values, opts ...Opt) error
- func (x *Secrets) List(ctx context.Context, out any, opts ...Opt) error
- func (x *Secrets) Put(ctx context.Context, name string, body any, opts ...Opt) error
- func (x *Secrets) Rotate(ctx context.Context, name string, body, out any, opts ...Opt) error
- type Sessions
- type Storage
- type Stream
- type Triggers
- type Types
- type Users
- func (x *Users) AcceptConsents(ctx context.Context, id string, body, out any, opts ...Opt) error
- func (x *Users) ChangeEmail(ctx context.Context, id string, body, out any, opts ...Opt) error
- func (x *Users) Create(ctx context.Context, body, out any, opts ...Opt) error
- func (x *Users) DeleteDevice(ctx context.Context, id, device string, opts ...Opt) error
- func (x *Users) Devices(ctx context.Context, id string, out any, opts ...Opt) error
- func (x *Users) Erase(ctx context.Context, id string, out any, opts ...Opt) error
- func (x *Users) ExpirePassword(ctx context.Context, id string, body, out any, opts ...Opt) error
- func (x *Users) Export(ctx context.Context, id, export string, out any, opts ...Opt) error
- func (x *Users) Identities(ctx context.Context, id string, out any, opts ...Opt) error
- func (x *Users) List(ctx context.Context, q url.Values, out any, opts ...Opt) error
- func (x *Users) MFA(ctx context.Context, id string, out any, opts ...Opt) error
- func (x *Users) OpenExport(ctx context.Context, id, export string, opts ...Opt) (*Stream, error)
- func (x *Users) Owned(ctx context.Context, id string, out any, opts ...Opt) error
- func (x *Users) Patch(ctx context.Context, id string, body, out any, opts ...Opt) error
- func (x *Users) ResetLink(ctx context.Context, id string, body, out any, opts ...Opt) error
- func (x *Users) ResetMFA(ctx context.Context, id string, opts ...Opt) error
- func (x *Users) Role(ctx context.Context, id, role string, grant bool, out any, opts ...Opt) error
- func (x *Users) SetNetworks(ctx context.Context, id string, body, out any, opts ...Opt) error
- func (x *Users) SetPassword(ctx context.Context, id string, body, out any, opts ...Opt) error
- func (x *Users) StartExport(ctx context.Context, id string, body, out any, opts ...Opt) error
- func (x *Users) UnlinkIdentity(ctx context.Context, id, provider string, opts ...Opt) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeys ¶
type APIKeys struct {
// contains filtered or unexported fields
}
APIKeys are the realm's API keys (_admin/apikeys).
type Admin ¶
type Admin struct {
AppConfig *AppConfig
APIKeys *APIKeys
Audit *Audit
Compliance *Compliance
Consents *Consents
DataChecks *DataChecks
DataMigrations *DataMigrations
Data *Data
Encryption *Encryption
Export *Export
Files *Files
Functions *Functions
Import *Import
Jobs *Jobs
MFA *MFA
Orgs *Orgs
Passwords *Passwords
Push *Push
Secrets *Secrets
Sessions *Sessions
Storage *Storage
Triggers *Triggers
Types *Types
Users *Users
// contains filtered or unexported fields
}
Admin calls the admin API through a client. Its fields group the endpoints by what they manage.
type AppConfig ¶
type AppConfig struct {
// contains filtered or unexported fields
}
AppConfig is the realm's app configuration (_admin/app-config).
type Audit ¶
type Audit struct {
// contains filtered or unexported fields
}
Audit is the audit trail (_admin/audit).
type Compliance ¶
type Compliance struct {
// contains filtered or unexported fields
}
Compliance is the realm's compliance scope (_admin/compliance).
type Consents ¶
type Consents struct {
// contains filtered or unexported fields
}
Consents are the consents of the realm's users (_admin/consents).
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data acts on documents regardless of their rules (_admin/data).
type DataChecks ¶
type DataChecks struct {
// contains filtered or unexported fields
}
DataChecks check the documents against their schemas (_admin/data-checks).
func (*DataChecks) Get ¶
Get reads the result of a check: of a database's collection, or the check with a name.
type DataMigrations ¶ added in v0.9.11
type DataMigrations struct {
// contains filtered or unexported fields
}
DataMigrations migrate the documents of versioned collections to their current schema version (_admin/data-migrations).
func (*DataMigrations) Get ¶ added in v0.9.11
func (x *DataMigrations) Get(ctx context.Context, database, name string, out any, opts ...Opt) error
Get reads the latest finished migration of a collection, in full.
type Encryption ¶
type Encryption struct {
// contains filtered or unexported fields
}
Encryption is field encryption (_admin/encryption).
type Export ¶
type Export struct {
// contains filtered or unexported fields
}
Export is the realm export (_admin/export): a plan, its parts, and the lease that keeps one export running at a time.
type Files ¶
type Files struct {
// contains filtered or unexported fields
}
Files regenerate and manage file versions (_admin/files).
type Functions ¶
type Functions struct {
// contains filtered or unexported fields
}
Functions invokes and controls functions (_admin/functions, _admin/schedules, _admin/invocations).
func (*Functions) Control ¶
func (x *Functions) Control(ctx context.Context, database, name, op string, out any, opts ...Opt) error
Control sends an operation to a function's schedule: "pause", "resume", "skip", …
func (*Functions) Invocations ¶
type Import ¶
type Import struct {
// contains filtered or unexported fields
}
Import loads an export into the realm (_admin/import).
type Jobs ¶
type Jobs struct {
// contains filtered or unexported fields
}
Jobs are the background jobs (_admin/jobs).
type MFA ¶
type MFA struct {
// contains filtered or unexported fields
}
MFA is the realm's second-factor policy (_admin/mfa).
type Orgs ¶
type Orgs struct {
// contains filtered or unexported fields
}
Orgs are the realm's organizations (_admin/orgs).
func (*Orgs) Invitations ¶
func (*Orgs) Reactivate ¶
func (*Orgs) RevokeInvitation ¶
type Passwords ¶
type Passwords struct {
// contains filtered or unexported fields
}
Passwords expire and notify (_admin/passwords).
type Push ¶
type Push struct {
// contains filtered or unexported fields
}
Push is the push notification side (_admin/push).
func (*Push) DeleteDevices ¶
DeleteDevices removes devices of a platform ("web", after the keys were rotated).
type Secrets ¶
type Secrets struct {
// contains filtered or unexported fields
}
Secrets are the realm's secrets (_admin/secrets).
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
Sessions ends the realm's sessions (_admin/sessions).
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is file storage (_admin/storage).
type Triggers ¶
type Triggers struct {
// contains filtered or unexported fields
}
Triggers are the function triggers (_admin/triggers).
func (*Triggers) ResolveGap ¶
type Types ¶
type Types struct {
// contains filtered or unexported fields
}
Types are the generated types of the realm (_admin/types).
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users are the realm's users (_admin/users).
func (*Users) AcceptConsents ¶
AcceptConsents records consents on behalf of a user.
func (*Users) ChangeEmail ¶
func (*Users) DeleteDevice ¶
func (*Users) ExpirePassword ¶
func (*Users) Identities ¶
func (*Users) OpenExport ¶
OpenExport opens the package of a ready export: the caller reads and closes the body.
func (*Users) SetNetworks ¶
SetNetworks sets the networks a user may sign in or administer from.
func (*Users) SetPassword ¶
func (*Users) StartExport ¶
StartExport starts a copy of a user's data.