api

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const RpcRetryInterval = 15 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessControlConfig

type AccessControlConfig struct {
	IPOracle IPOracleConfig `json:"ip_oracle"`
}

type AuthInfo

type AuthInfo struct {
	Environment string
	Role        string
	Username    string
	ValidFor    int
}

type Client

type Client struct {
	//    * Function name - my-function (name-only), my-function:v1 (with alias).
	//    * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.
	//    * Partial ARN - 123456789012:function:my-function.
	FunctionName string

	Debug int
	// contains filtered or unexported fields
}

func NewClient

func NewClient(target string) *Client

func (*Client) DirectSamlAuth

func (c *Client) DirectSamlAuth(req *DirectSamlAuthRequest) (*DirectAuthResponse, error)

func (*Client) Discovery

func (c *Client) Discovery(req *DiscoveryRequest) (*DiscoveryResponse, error)

func (*Client) GetConfig

func (c *Client) GetConfig(req *ConfigRequest) (*ConfigResponse, error)

func (*Client) WorkflowAuth

func (c *Client) WorkflowAuth(req *WorkflowAuthRequest) (*WorkflowAuthResponse, error)

func (*Client) WorkflowStart

func (c *Client) WorkflowStart(req *WorkflowStartRequest) (*WorkflowStartResponse, error)

type Config

type Config struct {
	Name          string              `json:"name"`
	Version       string              `json:"version"`
	Idp           []IdpConfig         `json:"idp"`
	Roles         []RoleConfig        `json:"roles"`
	Workflow      WorkflowConfig      `json:"workflow"`
	Credentials   []CredentialsConfig `json:"credentials"`
	AccessControl AccessControlConfig `json:"access_control"`
}

func (*Config) FindCredentialByName

func (c *Config) FindCredentialByName(name string) *CredentialsConfig

func (*Config) FindRoleByName

func (c *Config) FindRoleByName(name string) *RoleConfig

func (*Config) NormaliseAndLoad added in v0.1.2

func (c *Config) NormaliseAndLoad() error

func (*Config) Validate

func (c *Config) Validate() error

type ConfigPublic

type ConfigPublic struct {
	Name     string         `json:"name"`
	Idp      []IdpConfig    `json:"idp"`
	Roles    []RoleConfig   `json:"roles"`
	Workflow WorkflowConfig `json:"workflow"`
}

func (*ConfigPublic) FindRoleByName

func (c *ConfigPublic) FindRoleByName(name string) *RoleConfig

type ConfigRequest

type ConfigRequest struct {
}

type ConfigResponse

type ConfigResponse struct {
	Version string       `json:"version"`
	Config  ConfigPublic `json:"config"`
}

type Cred

type Cred struct {
	Name   string      `json:"name"`
	Type   string      `json:"type"`
	Expiry int64       `json:"expiry"`
	Value  interface{} `json:"value"`
}

func (*Cred) UnmarshalJSON

func (c *Cred) UnmarshalJSON(data []byte) error

type CredentialsConfig

type CredentialsConfig struct {
	Name   string      `json:"name"`
	Type   string      `json:"type"`
	Config interface{} `json:"config"`
}

func (*CredentialsConfig) UnmarshalJSON

func (c *CredentialsConfig) UnmarshalJSON(data []byte) error

type CredentialsConfigIAMAssumeRole

type CredentialsConfigIAMAssumeRole struct {
	TargetRole string `json:"target_role"`
}

type CredentialsConfigIAMUser

type CredentialsConfigIAMUser struct {
}

type CredentialsConfigKube

type CredentialsConfigKube struct {
	CAKey string `json:"ca_key"`
}

type CredentialsConfigSSH

type CredentialsConfigSSH struct {
	CAKey      string   `json:"ca_key"`
	Principals []string `json:"principals"`
}

type DirectAuthResponse

type DirectAuthResponse struct {
	Credentials map[string][]byte `json:"result"`
}

type DirectOidcAuthRequest

type DirectOidcAuthRequest struct {
}

type DirectSamlAuthRequest

type DirectSamlAuthRequest struct {
	RequestedRole string  `json:"requested_role"`
	SAMLResponse  string  `json:"saml_response"`
	SigAlg        string  `json:"sig_alg"`
	Signature     string  `json:"signature"`
	RelayState    *string `json:"relay_state,omitempty"`
}

type DiscoveryRequest

type DiscoveryRequest struct{}

type DiscoveryResponse

type DiscoveryResponse struct{}

type IAMCred

type IAMCred struct {
	ProfileName     string `json:"profile_name"`
	RoleArn         string `json:"role_arn"`
	RoleSessionName string `json:"role_session_name"`
	AccessKeyId     string `json:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key"`
	SessionToken    string `json:"session_token"`
}

type IPOracleConfig

type IPOracleConfig struct {
	WhiteListCidrs []string `json:"whitelist_cidrs"`
}

type IdpConfig

type IdpConfig struct {
	Name   string      `json:"name"`
	Type   string      `json:"type"`
	Config interface{} `json:"config"`
}

func (*IdpConfig) UnmarshalJSON

func (c *IdpConfig) UnmarshalJSON(data []byte) error

type IdpConfigOidc

type IdpConfigOidc struct {
}

type IdpConfigSaml

type IdpConfigSaml struct {
	Certificate  string `json:"certificate"`
	Audience     string `json:"audience"`
	UsernameAttr string `json:"username_attr"`
	EmailAttr    string `json:"email_attr"`
	GroupsAttr   string `json:"groups_attr"`
	RedirectURI  string `json:"redirect_uri"`
}

type KubeCred

type KubeCred struct {
	Username   string `json:"username"`
	PrivateKey string `json:"private_key"`
	PublicKey  string `json:"public_key"`
}

type Request

type Request struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload"`
}

func (*Request) UnmarshalJSON

func (c *Request) UnmarshalJSON(data []byte) error

type RoleConfig

type RoleConfig struct {
	Name               string                       `json:"name"`
	Workflow           string                       `json:"workflow"`
	Credentials        []string                     `json:"credentials"`
	ValidForSeconds    int                          `json:"valid_for_seconds"`
	CredentialDelivery RoleCredentialDeliveryConfig `json:"credential_delivery"`
	ClientDefaults     string                       `json:"client_defaults"`
}

type RoleCredentialDeliveryConfig

type RoleCredentialDeliveryConfig struct {
	KmsWrapWith string `json:"kms_wrap_with"`
}

type SSHCred

type SSHCred struct {
	Username    string `json:"username"`
	Certificate []byte `json:"certficate"`
	PrivateKey  []byte `json:"private_key"`
}

type WorkflowAuthRequest

type WorkflowAuthRequest struct {
	Username     string   `json:"username"`
	Role         string   `json:"role"`
	IssuingNonce string   `json:"issuing_nonce"`
	IdpNonce     string   `json:"idp_nonce"`
	Assertions   []string `json:"assertions"`
}

type WorkflowAuthResponse

type WorkflowAuthResponse struct {
	Credentials []Cred `json:"credentials"`
}

type WorkflowConfig

type WorkflowConfig struct {
	BaseUrl  string                 `json:"base_url"`
	Policies []WorkflowPolicyConfig `json:"policies"`
}

func (*WorkflowConfig) FindPolicyByName

func (wc *WorkflowConfig) FindPolicyByName(name string) *WorkflowPolicyConfig

type WorkflowPolicyConfig

type WorkflowPolicyConfig struct {
	Name                string         `json:"name"`
	IdpName             string         `json:"idp_name"`
	RequesterCanApprove bool           `json:"requester_can_approve"`
	IdentifyRoles       map[string]int `json:"identify_roles"`
	ApproverRoles       map[string]int `json:"approver_roles"`
}

type WorkflowStartRequest

type WorkflowStartRequest struct {
}

type WorkflowStartResponse

type WorkflowStartResponse struct {
	IssuingNonce string `json:"issuing_nonce"`
	IdpNonce     string `json:"idp_nonce"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL