/
types.go
58 lines (48 loc) · 1.14 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package app
import (
"github.com/JorgeReus/aws-sso-creds/internal/pkg/files"
"github.com/aws/aws-sdk-go/service/sso"
)
type SSOFlow struct {
accessToken *string
configFile *files.AWSFile
credentialsFile *files.AWSFile
ssoClient *sso.SSO
ssoRegion *string
ssoStartUrl *string
orgName string
prefix string
}
type AccountRolesOutput struct {
creds *sso.ListAccountRolesOutput
err error
}
type CredentialsResult struct {
ProfileName string
ExpiresAt string
WasSuccesful bool
}
type RoleCredentialsOutput struct {
creds *sso.GetRoleCredentialsOutput
roleName string
err error
}
type SessionUrlParams struct {
AccessKeyId string `json:"sessionId"`
SecretAccessKey string `json:"sessionKey"`
SessionToken string `json:"sessionToken"`
}
type LoginResponse struct {
SigninToken string `json:"SigninToken"`
}
type LoginUrlParams struct {
Issuer string
Destination string
SigninToken string
}
const AWS_FEDERATED_URL = "https://signin.aws.amazon.com/federation"
var (
clientName = "sso-oidc"
clientType = "public"
grantType = "urn:ietf:params:oauth:grant-type:device_code"
)