Documentation
¶
Overview ¶
Package org implements `w17ctl org` — list the organizations the logged-in user belongs to and choose the default one. The active org is a per-instance default in ~/.w17/auth.yaml; w17ctl threads it as the X-W17-Org selector so the console scopes requests to it (membership is validated server-side). `org pin` records an organization for a directory that is not a project, in a minimal w17/lock.yaml.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct {
List ListCmd `cmd:"" help:"List the organizations you belong to on the active console (--refresh re-fetches from the console)."`
Use UseCmd `cmd:"" help:"Set the default organization (by slug) for the active console — used to scope subsequent commands."`
Pin PinCmd `` /* 218-byte string literal not displayed */
}
Cmd is the `w17ctl org` group.
type ListCmd ¶
type ListCmd struct {
Refresh bool `name:"refresh" help:"Re-fetch memberships from the console and update the local cache."`
}
ListCmd is `w17ctl org list`.
type PinCmd ¶
type PinCmd struct {
Slug string `arg:"" help:"Organization slug to pin this directory to (one you are a member of)."`
}
PinCmd is `w17ctl org pin <slug>`.
A project's lock names its organization because the console stamps org_id into it at every signed write. A directory that is NOT a project — the plugins repository, where `plugin sign` and `plugin gen` run — has no lock for the console to stamp, so a run there named no organization at all. For a person with a default (`org use`) that went unnoticed; an environment token has no default, and a console facing an account in several organizations refuses to guess. This writes the minimal lock such a directory carries: org_id, the authoritative id, org_slug beside it for the reader (and as the key an api-realm token needs to have its memberships listed), and w17_url — the console whose organization it is, since an org id means nothing to any other console and is sent to none.
Written by hand it would be two lines; it is a command because the id is a UUID nobody types, and because the one place it must never be written is inside a project, whose lock is the console's.