Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session-duration in okta.yaml is not respected #181

Open
rickalm-wapo opened this issue Feb 16, 2024 · 3 comments
Open

session-duration in okta.yaml is not respected #181

rickalm-wapo opened this issue Feb 16, 2024 · 3 comments

Comments

@rickalm-wapo
Copy link

Other than the definition in the profile struct (SessionDuration) all other references are to AWSSessionDuration

@monde
Copy link
Collaborator

monde commented Feb 22, 2024

Thanks @rickalm-wapo I'll see about addressing this.

@monde
Copy link
Collaborator

monde commented Feb 23, 2024

@rickalm-wapo double checking with you, this is feedback on the variable name SessionDuration in config.go ? Is there a flaw or bug you've come up against?

@mikelorant
Copy link

mikelorant commented Mar 24, 2024

I'm also seeing expiry-aws-variables not respected either.

Why are the boolean values not set correctly in the struct?

type OktaYamlConfigProfile struct {
	AllProfiles         string `yaml:"all-profiles"`
	AuthzID             string `yaml:"authz-id"`
	AWSAcctFedAppID     string `yaml:"aws-acct-fed-app-id"`
	AWSCredentials      string `yaml:"aws-credentials"`
	AWSIAMIdP           string `yaml:"aws-iam-idp"`
	AWSIAMRole          string `yaml:"aws-iam-role"`
	AWSRegion           string `yaml:"aws-region"`
	CustomScope         string `yaml:"custom-scope"`
	Debug               string `yaml:"debug"`
	DebugAPICalls       string `yaml:"debug-api-calls"`
	Exec                string `yaml:"exec"`
	Format              string `yaml:"format"`
	OIDCClientID        string `yaml:"oidc-client-id"`
	OpenBrowser         string `yaml:"open-browser"`
	OpenBrowserCommand  string `yaml:"open-browser-command"`
	OrgDomain           string `yaml:"org-domain"`
	PrivateKey          string `yaml:"private-key"`
	PrivateKeyFile      string `yaml:"private-key-file"`
	KeyID               string `yaml:"key-id"`
	Profile             string `yaml:"profile"`
	QRCode              string `yaml:"qr-code"`
	SessionDuration     string `yaml:"session-duration"`
	WriteAWSCredentials string `yaml:"write-aws-credentials"`
	LegacyAWSVariables  string `yaml:"legacy-aws-variables"`
	ExpiryAWSVariables  string `yaml:"expiry-aws-variables"`
	CacheAccessToken    string `yaml:"cache-access-token"`
}

Not all these values are strings based on the Viper configuration.

attrs := Attributes{
    AllProfiles:         viper.GetBool(getFlagNameFromProfile(awsProfile, AllProfilesFlag)),
    AuthzID:             viper.GetString(getFlagNameFromProfile(awsProfile, AuthzIDFlag)),
    AWSCredentials:      viper.GetString(getFlagNameFromProfile(awsProfile, AWSCredentialsFlag)),
    AWSIAMIdP:           viper.GetString(getFlagNameFromProfile(awsProfile, AWSIAMIdPFlag)),
    AWSIAMRole:          viper.GetString(getFlagNameFromProfile(awsProfile, AWSIAMRoleFlag)),
    AWSRegion:           viper.GetString(getFlagNameFromProfile(awsProfile, AWSRegionFlag)),
    AWSSessionDuration:  viper.GetInt64(getFlagNameFromProfile(awsProfile, SessionDurationFlag)),
    CustomScope:         viper.GetString(getFlagNameFromProfile(awsProfile, CustomScopeFlag)),
    Debug:               viper.GetBool(getFlagNameFromProfile(awsProfile, DebugFlag)),
    DebugAPICalls:       viper.GetBool(getFlagNameFromProfile(awsProfile, DebugAPICallsFlag)),
    Exec:                viper.GetBool(getFlagNameFromProfile(awsProfile, ExecFlag)),
    FedAppID:            viper.GetString(getFlagNameFromProfile(awsProfile, AWSAcctFedAppIDFlag)),
    Format:              viper.GetString(getFlagNameFromProfile(awsProfile, FormatFlag)),
    LegacyAWSVariables:  viper.GetBool(getFlagNameFromProfile(awsProfile, LegacyAWSVariablesFlag)),
    ExpiryAWSVariables:  viper.GetBool(getFlagNameFromProfile(awsProfile, ExpiryAWSVariablesFlag)),
    CacheAccessToken:    viper.GetBool(getFlagNameFromProfile(awsProfile, CacheAccessTokenFlag)),
    OIDCAppID:           viper.GetString(getFlagNameFromProfile(awsProfile, OIDCClientIDFlag)),
    OpenBrowser:         viper.GetBool(getFlagNameFromProfile(awsProfile, OpenBrowserFlag)),
    OpenBrowserCommand:  viper.GetString(getFlagNameFromProfile(awsProfile, OpenBrowserCommandFlag)),
    OrgDomain:           viper.GetString(getFlagNameFromProfile(awsProfile, OrgDomainFlag)),
    PrivateKey:          viper.GetString(getFlagNameFromProfile(awsProfile, PrivateKeyFlag)),
    PrivateKeyFile:      viper.GetString(getFlagNameFromProfile(awsProfile, PrivateKeyFileFlag)),
    KeyID:               viper.GetString(getFlagNameFromProfile(awsProfile, KeyIDFlag)),
    Profile:             awsProfile,
    QRCode:              viper.GetBool(getFlagNameFromProfile(awsProfile, QRCodeFlag)),
    WriteAWSCredentials: viper.GetBool(getFlagNameFromProfile(awsProfile, WriteAWSCredentialsFlag)),
}

This may be part of the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants