Documentation
¶
Index ¶
- Variables
- func ApikeyCreate(c *kli.CommandContext) error
- func ApikeyList(c *kli.CommandContext) error
- func ApikeyRevoke(c *kli.CommandContext) error
- func AppConfigGet(c *kli.CommandContext) error
- func AppConfigHistory(c *kli.CommandContext) error
- func AppConfigReset(c *kli.CommandContext) error
- func AppConfigRollback(c *kli.CommandContext) error
- func AppConfigSet(c *kli.CommandContext) error
- func AuditAction(c *kli.CommandContext) error
- func ComplianceScopeCmd(c *kli.CommandContext) error
- func ConsentsNotify(c *kli.CommandContext) error
- func ConsentsRecord(c *kli.CommandContext) error
- func DataAssignOrg(c *kli.CommandContext) error
- func DataCheck(c *kli.CommandContext) error
- func DataChecks(c *kli.CommandContext) error
- func DataMigrate(c *kli.CommandContext) error
- func DataMigrations(c *kli.CommandContext) error
- func DataTransfer(c *kli.CommandContext) error
- func EachChunk(r io.Reader, max int64, fn func(chunk []byte, firstLine int) error) error
- func EncryptMigrate(c *kli.CommandContext) error
- func EncryptRekey(c *kli.CommandContext) error
- func EncryptStatus(c *kli.CommandContext) error
- func FileIDsOf(path string, fields []string) ([]string, error)
- func FilesRegenerate(c *kli.CommandContext) error
- func FunctionsCancel(c *kli.CommandContext) error
- func FunctionsHistory(c *kli.CommandContext) error
- func FunctionsInvoke(c *kli.CommandContext) error
- func FunctionsJobs(c *kli.CommandContext) error
- func FunctionsLogs(c *kli.CommandContext) error
- func FunctionsPause(c *kli.CommandContext) error
- func FunctionsRerun(c *kli.CommandContext) error
- func FunctionsResume(c *kli.CommandContext) error
- func FunctionsSchedules(c *kli.CommandContext) error
- func LocalSettings(realm string, getenv func(string) string) *registry.RealmSettings
- func OrgsAddMember(c *kli.CommandContext) error
- func OrgsAssignOwner(c *kli.CommandContext) error
- func OrgsClaimsSet(c *kli.CommandContext) error
- func OrgsCreate(c *kli.CommandContext) error
- func OrgsDelete(c *kli.CommandContext) error
- func OrgsDomainAdd(c *kli.CommandContext) error
- func OrgsDomainRemove(c *kli.CommandContext) error
- func OrgsDomainVerify(c *kli.CommandContext) error
- func OrgsDomains(c *kli.CommandContext) error
- func OrgsInvitations(c *kli.CommandContext) error
- func OrgsInvite(c *kli.CommandContext) error
- func OrgsList(c *kli.CommandContext) error
- func OrgsMembers(c *kli.CommandContext) error
- func OrgsOwned(c *kli.CommandContext) error
- func OrgsReactivate(c *kli.CommandContext) error
- func OrgsRevokeInvitation(c *kli.CommandContext) error
- func OrgsSSO(c *kli.CommandContext) error
- func OrgsSSODelete(c *kli.CommandContext) error
- func OrgsSSORequiredOff(c *kli.CommandContext) error
- func OrgsSSOSet(c *kli.CommandContext) error
- func OrgsSetSlug(c *kli.CommandContext) error
- func OrgsShow(c *kli.CommandContext) error
- func PushDevices(c *UserCtx) error
- func PushRemoveDevice(c *UserCtx) error
- func PushSends(c *kli.CommandContext) error
- func PushTest(c *UserCtx) error
- func PushWebKeys(c *kli.CommandContext) error
- func RegisterFieldKeys(sec *kli.CommandBuilder, o Opener)
- func RegisterTransfer(cfg *kli.Config, o Opener)
- func SecretDelete(c *kli.CommandContext) error
- func SecretRef(scope, name string) string
- func SecretSet(c *kli.CommandContext) error
- func StorageCheck(c *kli.CommandContext) error
- func StorageReconcile(c *kli.CommandContext) error
- func StorageUsage(c *kli.CommandContext) error
- func TriggersGaps(c *kli.CommandContext) error
- func TriggersResolve(c *kli.CommandContext) error
- func TriggersStatus(c *kli.CommandContext) error
- func UserChangeEmail(c *UserCtx) error
- func UserCreate(c *UserCtx) error
- func UserDelete(c *UserCtx) error
- func UserExpirePassword(c *UserCtx) error
- func UserExpirePasswords(c *UserCtx) error
- func UserExport(c *UserCtx) error
- func UserExportDownload(c *UserCtx) error
- func UserIdentities(c *UserCtx) error
- func UserList(c *UserCtx) error
- func UserMFAReset(c *UserCtx) error
- func UserMFAStatus(c *UserCtx) error
- func UserNetworks(c *UserCtx) error
- func UserNotifyExpired(c *UserCtx) error
- func UserOwned(c *UserCtx) error
- func UserPatch(body map[string]bool, message string) func(*UserCtx) error
- func UserResetLink(c *UserCtx) error
- func UserRevokeSessions(c *UserCtx) error
- func UserRole(c *UserCtx, verb, role string) error
- func UserSetPassword(c *UserCtx) error
- func UserUnlinkIdentity(c *UserCtx) error
- func WriteSecretFile(path, content string) error
- type AuditRecord
- type FileRef
- type Opener
- type Session
- type UserCtx
Constants ¶
This section is empty.
Variables ¶
var ExportPoll = 2 * time.Second
exportPoll is how often the CLI asks whether an export is ready.
var Remote = Opener{ Prog: "backd", Flags: clicore.Remote, Open: func(c *kli.CommandContext) (*Session, error) { t, err := clicore.TargetOf(c, false) if err != nil { return nil, err } return &Session{t: t, Close: func() {}}, nil }, Note: clicore.AdminAPINote, }
Remote is the CLI's opener: the realm's admin API on a running backd.
Functions ¶
func ApikeyCreate ¶
func ApikeyCreate(c *kli.CommandContext) error
func ApikeyList ¶
func ApikeyList(c *kli.CommandContext) error
func ApikeyRevoke ¶
func ApikeyRevoke(c *kli.CommandContext) error
func AppConfigGet ¶
func AppConfigGet(c *kli.CommandContext) error
appConfigGet handles `backd app-config get`: every key with its value, or one key.
func AppConfigHistory ¶
func AppConfigHistory(c *kli.CommandContext) error
appConfigHistory handles `backd app-config history`.
func AppConfigReset ¶
func AppConfigReset(c *kli.CommandContext) error
appConfigReset handles `backd app-config reset --keys a,b`.
func AppConfigRollback ¶
func AppConfigRollback(c *kli.CommandContext) error
appConfigRollback handles `backd app-config rollback --version c2`.
func AppConfigSet ¶
func AppConfigSet(c *kli.CommandContext) error
appConfigSet handles `backd app-config set`: one key with --key and --value, or several with --values.
func ComplianceScopeCmd ¶
func ComplianceScopeCmd(c *kli.CommandContext) error
complianceScopeCmd handles `backd compliance scope`: what a user's data export takes from each collection, and why anything is left out.
func ConsentsNotify ¶
func ConsentsNotify(c *kli.CommandContext) error
consentsNotify handles `backd consents notify`: ask the users who hold an older version of a consent to review the current one, by email.
func ConsentsRecord ¶
func ConsentsRecord(c *kli.CommandContext) error
consentsRecord handles `backd consents record`: an administrator records a consent a person gave, or withdrew, outside the app, with the evidence for it.
func DataAssignOrg ¶
func DataAssignOrg(c *kli.CommandContext) error
dataAssignOrg gives the documents of a collection that have no organization one.
func DataCheck ¶
func DataCheck(c *kli.CommandContext) error
dataCheck handles `backd data check`: it starts a schema check, follows its progress, prints the reports and exits non-zero when it found drift.
func DataChecks ¶
func DataChecks(c *kli.CommandContext) error
dataChecks handles `backd data checks`: the latest reports (or one in full).
func DataMigrate ¶ added in v0.9.11
func DataMigrate(c *kli.CommandContext) error
DataMigrate handles `backd data migrate`: it queues the migration of a collection's documents to its current schema version (workers also do it at every start), and with --wait follows it and exits 0 when every document migrated and 1 when some did not.
func DataMigrations ¶ added in v0.9.11
func DataMigrations(c *kli.CommandContext) error
DataMigrations handles `backd data migrations`: every collection with migrations (or one report in full).
func DataTransfer ¶
func DataTransfer(c *kli.CommandContext) error
dataTransfer moves one document to another organization (or out of its organization with --org none), and to a team of it (--team, or --team none), as an administrator.
func EachChunk ¶
eachChunk reads JSON Lines and calls fn with groups of whole lines of up to max bytes (a longer line goes alone), with the number of the first line of the group.
func EncryptMigrate ¶
func EncryptMigrate(c *kli.CommandContext) error
encryptMigrate queues the migration of a collection and follows it.
func EncryptRekey ¶
func EncryptRekey(c *kli.CommandContext) error
encryptRekey starts a new generation of an encrypted field's data key.
func EncryptStatus ¶
func EncryptStatus(c *kli.CommandContext) error
encryptStatus prints, per encrypted field, how its values are stored and how far the migration to the configuration is.
func FileIDsOf ¶
fileIDsOf lists the ids of the files the documents of a part hold in the given file fields.
func FilesRegenerate ¶
func FilesRegenerate(c *kli.CommandContext) error
filesRegenerate handles `backd files regenerate`: it starts the job that makes the stale image versions of a file field again and follows it.
func FunctionsCancel ¶
func FunctionsCancel(c *kli.CommandContext) error
functionsCancel handles `backd functions cancel`: ends a job that hasn't finished.
func FunctionsHistory ¶
func FunctionsHistory(c *kli.CommandContext) error
functionsHistory handles `backd functions history`.
func FunctionsInvoke ¶
func FunctionsInvoke(c *kli.CommandContext) error
functionsInvoke handles `backd functions invoke`: a normal call to a running backd, through the same route and rules any other caller goes through (not a local shortcut), so what it shows is what production does.
func FunctionsJobs ¶
func FunctionsJobs(c *kli.CommandContext) error
functionsJobs handles `backd functions jobs`: the realm's async and scheduled jobs, newest first, for one function or all of them.
func FunctionsLogs ¶
func FunctionsLogs(c *kli.CommandContext) error
functionsLogs handles `backd functions logs`.
func FunctionsPause ¶
func FunctionsPause(c *kli.CommandContext) error
func FunctionsRerun ¶
func FunctionsRerun(c *kli.CommandContext) error
functionsRerun handles `backd functions rerun`: queues a finished job again.
func FunctionsResume ¶
func FunctionsResume(c *kli.CommandContext) error
func FunctionsSchedules ¶
func FunctionsSchedules(c *kli.CommandContext) error
functionsSchedules handles `backd functions schedules`.
func LocalSettings ¶
func LocalSettings(realm string, getenv func(string) string) *registry.RealmSettings
localSettings returns the realm's settings from CONFIG_DIR, if it is set and loads: run next to the server's config (in its container, say), the CLI can tell which assignments realm.yaml makes.
func OrgsAddMember ¶
func OrgsAddMember(c *kli.CommandContext) error
func OrgsAssignOwner ¶
func OrgsAssignOwner(c *kli.CommandContext) error
func OrgsClaimsSet ¶
func OrgsClaimsSet(c *kli.CommandContext) error
func OrgsCreate ¶
func OrgsCreate(c *kli.CommandContext) error
func OrgsDelete ¶
func OrgsDelete(c *kli.CommandContext) error
func OrgsDomainAdd ¶ added in v0.9.13
func OrgsDomainAdd(c *kli.CommandContext) error
func OrgsDomainRemove ¶ added in v0.9.13
func OrgsDomainRemove(c *kli.CommandContext) error
func OrgsDomainVerify ¶ added in v0.9.13
func OrgsDomainVerify(c *kli.CommandContext) error
func OrgsDomains ¶ added in v0.9.13
func OrgsDomains(c *kli.CommandContext) error
func OrgsInvitations ¶
func OrgsInvitations(c *kli.CommandContext) error
func OrgsInvite ¶
func OrgsInvite(c *kli.CommandContext) error
orgsInvite creates an invitation: bound to an address (--email), to a user (--user) or open (--open). It prints the link, which is shown only now.
func OrgsList ¶
func OrgsList(c *kli.CommandContext) error
func OrgsMembers ¶
func OrgsMembers(c *kli.CommandContext) error
func OrgsOwned ¶
func OrgsOwned(c *kli.CommandContext) error
func OrgsReactivate ¶
func OrgsReactivate(c *kli.CommandContext) error
func OrgsRevokeInvitation ¶
func OrgsRevokeInvitation(c *kli.CommandContext) error
func OrgsSSO ¶
func OrgsSSO(c *kli.CommandContext) error
func OrgsSSODelete ¶
func OrgsSSODelete(c *kli.CommandContext) error
func OrgsSSORequiredOff ¶
func OrgsSSORequiredOff(c *kli.CommandContext) error
func OrgsSSOSet ¶
func OrgsSSOSet(c *kli.CommandContext) error
func OrgsSetSlug ¶
func OrgsSetSlug(c *kli.CommandContext) error
func OrgsShow ¶
func OrgsShow(c *kli.CommandContext) error
func PushDevices ¶
pushDevices lists a user's registered devices: never their tokens.
func PushRemoveDevice ¶
pushRemoveDevice removes one device of a user; the removal is audited.
func PushSends ¶
func PushSends(c *kli.CommandContext) error
pushSends lists the realm's sends, or shows one with --id.
func PushWebKeys ¶
func PushWebKeys(c *kli.CommandContext) error
pushWebKeys makes the realm's VAPID key pair: the private key becomes a realm secret, the public one is printed with the realm.yaml snippet. It refuses to replace a key without --rotate, and rotating removes every web device: browsers made their subscriptions under the old public key, so they all need to subscribe again.
func RegisterFieldKeys ¶
func RegisterFieldKeys(sec *kli.CommandBuilder, o Opener)
RegisterFieldKeys adds secret create, rotate and list (the field keys) to sec, through o.
func RegisterTransfer ¶
RegisterTransfer adds export and import to cfg, through o.
func SecretDelete ¶
func SecretDelete(c *kli.CommandContext) error
func SecretRef ¶
SecretRef names a secret as function.yaml would: realm.NAME for the realm scope, NAME for a database's, and org:<id>.NAME for an organization's (scope is the database or orgScope).
func SecretSet ¶
func SecretSet(c *kli.CommandContext) error
func StorageCheck ¶
func StorageCheck(c *kli.CommandContext) error
storageCheck handles `backd storage check`: the running backd verifies the realm's storage (it holds the access keys) and the report is printed. Exits 1 when a step failed.
func StorageReconcile ¶
func StorageReconcile(c *kli.CommandContext) error
storageReconcile handles `backd storage reconcile`: the running backd lists the realm's objects and reports (or, with --delete, removes) the ones no document references. It does each storage the realm has (--storage private|public picks one).
func StorageUsage ¶
func StorageUsage(c *kli.CommandContext) error
storageUsage handles `backd storage usage`: what the realm's storage is, whether it works, what the documents hold in it and what waits to be cleaned up.
func TriggersGaps ¶
func TriggersGaps(c *kli.CommandContext) error
triggersGaps handles `backd triggers gaps`.
func TriggersResolve ¶
func TriggersResolve(c *kli.CommandContext) error
triggersResolve handles `backd triggers resolve`.
func TriggersStatus ¶
func TriggersStatus(c *kli.CommandContext) error
triggersStatus handles `backd triggers status`.
func UserChangeEmail ¶
func UserCreate ¶
func UserDelete ¶
func UserExpirePassword ¶
func UserExpirePasswords ¶
func UserExport ¶
userExport handles `backd user export`: it asks for the export of a user's personal data, waits for it, and writes the package (a zip) to --out. The user is told, unless --no-notify and a reason say why not.
func UserExportDownload ¶
userExportDownload handles `backd user export-download`: it fetches an export made earlier.
func UserIdentities ¶
userIdentities lists the user's sign-in methods.
func UserMFAReset ¶
userMFAReset removes a user's second factor through the admin API.
func UserMFAStatus ¶
userMFAStatus shows one user's second factor, or who must still set one up.
func UserNetworks ¶
userNetworks shows or changes a user's network restrictions.
func UserNotifyExpired ¶
func UserPatch ¶
userPatch returns a command that changes one field of the user and prints message with the user's email.
func UserResetLink ¶
func UserRevokeSessions ¶
func UserSetPassword ¶
func UserUnlinkIdentity ¶
userUnlinkIdentity removes one of the user's sign-in methods.
func WriteSecretFile ¶
writeSecretFile writes a file only its owner can read, even if one with wider permissions was there before.
Types ¶
type AuditRecord ¶
type FileRef ¶
fileRef is a file a document holds, as far as a package needs to know: a public one is imported into the target's public storage, under the name its address ends with.
type Opener ¶
type Opener struct {
Prog string // the program: the commands are named "<Prog> export"
Flags func(cc *kli.CommandConfig) // the flags that say where the realm is
Open func(c *kli.CommandContext) (*Session, error)
Note string // how the commands reach the realm, ending their help
}
An Opener is where the commands that work on a realm's data through its admin API find it. The CLI's is a running backd (Remote); backd-server's is that same admin handler run in its own process over MongoDB and CONFIG_DIR, with no server (see internal/servercli). Export, import and the field key commands are written once and registered in both trees with their opener.
type Session ¶
type Session struct {
Close func()
// BeforeWrite, when set, runs before an import writes anything (backd-server refuses
// while an instance serves the realm).
BeforeWrite func(c *kli.CommandContext) error
// contains filtered or unexported fields
}
A Session is an opened realm.