Documentation ¶
Index ¶
- Variables
- func DownloadSAMLMetadata(metadataUrl string) (*samlTypes.EntityDescriptor, error)
- func GetFederationURL(host string, token string, car CAR) (string, error)
- func ReadSAMLMetadataFile(metadataFile string) (*samlTypes.EntityDescriptor, error)
- type AccessData
- type Account
- type AccountResponse
- type AccountsResponse
- type AuthData
- type AuthRequest
- type AuthResponse
- type CAR
- type CARResponse
- type CSRFResponse
- type ConsoleAccessCAR
- type ConsoleAccessCARResponse
- type IDMS
- type IDMSResponse
- type Project
- type ProjectResponse
- type SSOAuthResponse
- type STAK
- type STAKRequest
- type STAKResponse
- type SamlCallbackResult
- type Session
- type TokenData
- type URLRequest
- type URLResponse
Constants ¶
This section is empty.
Variables ¶
var (
// SAMLLocalAuthPort is the port to use to accept back the access token from SAML
SAMLLocalAuthPort = "8400"
)
Functions ¶
func DownloadSAMLMetadata ¶
func DownloadSAMLMetadata(metadataUrl string) (*samlTypes.EntityDescriptor, error)
func GetFederationURL ¶
GetFederationURL queries the Kion API to generate a federation URL.
func ReadSAMLMetadataFile ¶
func ReadSAMLMetadataFile(metadataFile string) (*samlTypes.EntityDescriptor, error)
Types ¶
type AccessData ¶
type AccessData struct {
Access TokenData `json:"access"`
}
type Account ¶
type Account struct { Email string `json:"account_email"` Name string `json:"account_name"` Number string `json:"account_number"` TypeID uint `json:"account_type_id"` ID uint `json:"id"` IncludeLinkedAccountSpend bool `json:"include_linked_account_spend"` LinkedAccountNumber string `json:"linked_account_number"` LinkedRole string `json:"linked_role"` PayerID uint `json:"payer_id"` ProjectID uint `json:"project_id"` SkipAccessChecking bool `json:"skip_access_checking"` UseOrgAccountInfo bool `json:"use_org_account_info"` }
Account maps to the Kion API response for account data.
func GetAccount ¶
GetAccount returns an account by the given account number
type AccountResponse ¶
type AccountsResponse ¶
AccountResponse maps to the Kion API response.
type AuthData ¶
func AuthenticateSAML ¶
type AuthRequest ¶
type AuthRequest struct { IDMSID uint `json:"idms"` Username string `json:"username"` Password string `json:"password"` }
AuthRequest maps to the required post body when interfacing with the Kion API.
type AuthResponse ¶
AuthResponse maps to the Kion API response.
type CAR ¶
type CAR struct { AccountID uint `json:"account_id"` AccountNumber string `json:"account_number"` AccountType string `json:"account_type"` AccountTypeID uint AccountName string ApplyToAllAccounts bool `json:"apply_to_all_accounts"` AwsIamPath string `json:"aws_iam_path"` AwsIamRoleName string `json:"aws_iam_role_name"` CloudAccessRoleType string `json:"cloud_access_role_type"` CreatedAt struct { Time time.Time `json:"Time"` Valid bool `json:"Valid"` } `json:"created_at"` DeletedAt struct { Time time.Time `json:"Time"` Valid bool `json:"Valid"` } `json:"deleted_at"` FutureAccounts bool `json:"future_accounts"` ID uint `json:"id"` LongTermAccessKeys bool `json:"long_term_access_keys"` Name string `json:"name"` ProjectID uint `json:"project_id"` ShortTermAccessKeys bool `json:"short_term_access_keys"` UpdatedAt struct { Time time.Time `json:"Time"` Valid bool `json:"Valid"` } `json:"updated_at"` WebAccess bool `json:"web_access"` }
CAR maps to the Kion API response for cloud access roles.
func GetCARByName ¶ added in v0.0.2
GetCARByNameAndAccount returns a car that matches a given name for a given account number
func GetCARS ¶
GetCARS queries the Kion API for all cloud access roles to which the authenticated user has access.
func GetCARSOnAccount ¶
GetCARSOnAccount returns all cloud access roles that match a given account
type CARResponse ¶
CARResponse maps to the Kion API response.
type CSRFResponse ¶
type CSRFResponse struct {
Data string `json:"data"`
}
type ConsoleAccessCAR ¶ added in v0.0.2
type ConsoleAccessCAR struct { CARName string `json:"name"` CARID uint `json:"id"` CARRoleType string `json:"role_type"` Accounts []Account `json:"accounts"` ConsoleAccess bool `json:"console_access"` STAKAccess bool `json:"short_term_key_access"` LTAKAccess bool `json:"long_term_key_access"` AwsIamRoleName string `json:"aws_iam_role_name"` }
Account maps to the Kion API response for account data.
func GetConsoleAccessCARS ¶ added in v0.0.2
func GetConsoleAccessCARS(host string, token string, projID uint) ([]ConsoleAccessCAR, error)
type ConsoleAccessCARResponse ¶ added in v0.0.2
type ConsoleAccessCARResponse struct { Status int `json:"status"` ConsoleAccessCARs []ConsoleAccessCAR `json:"data"` }
ConsoleAccessResponse maps to the Kion V1 API response.
type IDMS ¶
type IDMS struct { ID uint `json:"id"` IdmsTypeID uint `json:"idms_type_id"` Name string `json:"name"` }
IDMS maps to the Kion API response for configured IDMSs.
type IDMSResponse ¶
IDMSResponse maps to the Kion API response.
type Project ¶
type Project struct { Archived bool `json:"archived"` AutoPay bool `json:"auto_pay"` DefaultAwsRegion string `json:"default_aws_region"` Description string `json:"description"` ID uint `json:"id"` Name string `json:"name"` OuID uint `json:"ou_id"` }
Project maps to the Kion API response for projects.
type ProjectResponse ¶
ProjectResponse maps to the Kion API response.
type SSOAuthResponse ¶
type SSOAuthResponse struct {
Data AccessData `json:"data"`
}
type STAK ¶
type STAK struct { AccessKey string `json:"access_key"` SecretAccessKey string `json:"secret_access_key"` SessionToken string `json:"session_token"` }
STAK maps to the Kion API response for short term access keys.
type STAKRequest ¶
type STAKRequest struct { AccountNumber string `json:"account_number"` CARName string `json:"cloud_access_role_name"` }
STAKRequest maps to the required post body when interfacing with the Kion API.
type STAKResponse ¶
STAKResponse maps to the Kion API response.
type SamlCallbackResult ¶
type Session ¶
type Session struct { // ID int `json:"id"` IDMSID uint UserName string // UserID int `json:"user_id"` Access struct { Expiry string `json:"expiry"` Token string `json:"token"` } `json:"access"` Refresh struct { Expiry string `json:"expiry"` Token string `json:"token"` } `json:"refresh"` }
Session maps to the session data returned by Kion after authentication.
type URLRequest ¶
type URLRequest struct { AccountID uint `json:"account_id"` AccountName string `json:"account_name"` AccountNumber string `json:"account_number"` AWSIAMRoleName string `json:"aws_iam_role_name"` AccountTypeID uint `json:"account_type_id"` RoleID uint `json:"role_id"` RoleType string `json:"role_type"` }