diff --git a/lib/kion/console.go b/lib/kion/console.go index 32d59ec..75d3fe9 100644 --- a/lib/kion/console.go +++ b/lib/kion/console.go @@ -31,6 +31,15 @@ type URLRequest struct { // GetFederationURL queries the Kion API to generate a federation URL. func GetFederationURL(host string, token string, car CAR) (string, error) { + // converting cloud access role type to role type + var roleType string + switch car.CloudAccessRoleType { + case "inherited": + roleType = "ou" + case "local": + roleType = "project" + } + // build our query and get response url := fmt.Sprintf("%v/api/v1/console-access", host) query := map[string]string{} @@ -41,7 +50,7 @@ func GetFederationURL(host string, token string, car CAR) (string, error) { AWSIAMRoleName: car.AwsIamRoleName, AccountTypeID: car.AccountTypeID, RoleID: car.ID, - RoleType: car.CloudAccessRoleType, + RoleType: roleType, } resp, _, err := runQuery("POST", url, token, query, data) if err != nil {