Documentation ¶
Index ¶
- Variables
- func FetchAll(client *Client, org *mono_models.Organization) ([]*secretsModels.UserSecret, error)
- func FetchDefinitions(client *Client, projectID strfmt.UUID) ([]*secretsModels.SecretDefinition, error)
- func Reset()
- func SaveSecretShares(client *Client, org *mono_models.Organization, user *mono_models.User, ...) error
- type Client
- type Scope
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errs.New("Secret not found") ErKeypairSave = errs.New("Could not save keypair") )
Functions ¶
func FetchAll ¶
func FetchAll(client *Client, org *mono_models.Organization) ([]*secretsModels.UserSecret, error)
FetchAll fetchs the current user's secrets for an organization.
func FetchDefinitions ¶
func FetchDefinitions(client *Client, projectID strfmt.UUID) ([]*secretsModels.SecretDefinition, error)
FetchDefinitions fetchs the secret definitions for a given project.
func SaveSecretShares ¶
func SaveSecretShares(client *Client, org *mono_models.Organization, user *mono_models.User, shares []*secretsModels.UserSecretShare) error
Types ¶
type Client ¶
type Client struct { *secrets_client.Secrets BaseURI string // contains filtered or unexported fields }
Client encapsulates a Secrets Service API client and its configuration
var DefaultClient *Client
DefaultClient 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.
func Get ¶
func Get(auth *authentication.Auth) *Client
Get is an alias for InitializeClient used to persist our Get() pattern used throughout the codebase
func GetClient ¶
func GetClient(auth *authentication.Auth) *Client
GetClient gets the cached (if any) client instance that was initialized using our default settings
func InitializeClient ¶
func InitializeClient(auth *authentication.Auth) *Client
InitializeClient 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.
func NewClient ¶
func NewClient(schema, host, basePath string, auth *authentication.Auth) *Client
NewClient 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.
func NewDefaultClient ¶
func NewDefaultClient(auth *authentication.Auth) *Client
NewDefaultClient creates a new Client using constants SecretsAPISchema, -Host, and -Path and a provided Bearer-token value.
func (*Client) AuthenticatedUserID ¶
AuthenticatedUserID 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.