{"modulePath":"github.com/ActiveState/cli","version":"v0.0.0-20261125184344-355e69c2df15","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package secrets\n\n## Variables\n\n```go\nvar (\n\tErrNotFound   = errs.New(\"Secret not found\")\n\tErKeypairSave = errs.New(\"Could not save keypair\")\n)\n```\n\n## Functions\n\n```go\nfunc FetchAll(client *Client, org *mono_models.Organization) ([]*secretsModels.UserSecret, error)\n```\nFetchAll fetchs the current user's secrets for an organization.\n\n```go\nfunc FetchDefinitions(client *Client, projectID strfmt.UUID) ([]*secretsModels.SecretDefinition, error)\n```\nFetchDefinitions fetchs the secret definitions for a given project.\n\n```go\nfunc Reset()\n```\nReset will reset the client cache\n\n```go\nfunc SaveSecretShares(client *Client, org *mono_models.Organization, user *mono_models.User, shares []*secretsModels.UserSecretShare) error\n```\n\n## Types\n\n```go\ntype Client struct {\n\t*secrets_client.Secrets\n\tBaseURI string\n\t// contains filtered or unexported fields\n}\n```\nClient encapsulates a Secrets Service API client and its configuration\n\n```go\nvar DefaultClient *Client\n```\nDefaultClient represents a secretsapi Client instance that can be accessed by any package needing it. DefaultClient should be set by a call to InitializeClient; this, it can be nil.\n\n```go\nfunc Get(auth *authentication.Auth) *Client\n```\nGet is an alias for InitializeClient used to persist our Get() pattern used throughout the codebase\n\n```go\nfunc GetClient(auth *authentication.Auth) *Client\n```\nGetClient gets the cached (if any) client instance that was initialized using our default settings\n\n```go\nfunc InitializeClient(auth *authentication.Auth) *Client\n```\nInitializeClient will create new Client using defaults, including the api.BearerToken value. This new Client instance will be accessible as secretapi.DefaultClient afterwards. Calling this function multiple times will redefine the DefaultClient value using the defaults/constants available to it at the time of the call; thus, the DefaultClient can be re-initialized this way. Because this function is dependent on a runtime-value from pkg/platform/api, we are not relying on the init() function for instantiation; this must be called explicitly.\n\n```go\nfunc NewClient(schema, host, basePath string, auth *authentication.Auth) *Client\n```\nNewClient creates a new SecretsAPI client instance using the provided HTTP settings. It also expects to receive the actual Bearer token value that will be passed in each API request in order to authenticate each request.\n\n```go\nfunc NewDefaultClient(auth *authentication.Auth) *Client\n```\nNewDefaultClient creates a new Client using constants SecretsAPISchema, -Host, and -Path and a provided Bearer-token value.\n\n```go\nfunc (client *Client) AuthenticatedUserID() (strfmt.UUID, error)\n```\nAuthenticatedUserID will check with the Secrets Service to ensure the current Bearer token is a valid one and return the user's UID in the response. Otherwise, this function will return a Failure.\n\n```go\nfunc (client *Client) Persist()\n```\nPersist will make the current client the persistentClient\n\n```go\ntype Scope string\n```\nScope covers what scope a secret belongs to\n\n```go\nvar (\n\t// ScopeUser is the user scope\n\tScopeUser Scope = \"user\"\n\n\t// ScopeProject is the project scope\n\tScopeProject Scope = \"project\"\n)\n```\n\n","path":"github.com/ActiveState/cli/pkg/platform/api/secrets","name":"secrets","synopsis":"","isRedistributable":true}
