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

Add support for credential_process #1486

Closed

Conversation

albertomurillo
Copy link

Fixes #1485

Signed-off-by: Alberto Murillo [email protected]

pkg/credentials/file_aws_credentials.go Outdated Show resolved Hide resolved
return !p.retrieved
}

now := time.Now()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to add lee-way you can't expire at the last nano-second @albertomurillo look at iam_aws implementation for ideas.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need this you can just call p.IsExpired() now @albertomurillo

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I updated FileAWSCredentials struct to make use of credentials.go Expiry.

Now that DefaultExpiryWindow is being used in two files, what do you think about refactoring it closer to Expiry definition in credentials.go ?

Fixes minio#1485

Signed-off-by: Alberto Murillo <[email protected]>
credential_process := iniProfile.Key("credential_process").String()
if credential_process != "" {
args := strings.Fields(credential_process)
cmd := exec.Command(args[0], args[1:]...)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validate len(args) > 1 to avoid crash.

@@ -90,6 +105,31 @@ func (p *FileAWSCredentials) Retrieve() (Value, error) {
// Default to empty string if not found.
token := iniProfile.Key("aws_session_token")

// If credential_process is defined, obtain credentials by executing
// the external process
credential_process := iniProfile.Key("credential_process").String()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case:

Suggested change
credential_process := iniProfile.Key("credential_process").String()
credentialProcess := iniProfile.Key("credential_process").String()

@harshavardhana
Copy link
Member

@albertomurillo Please re-submit the PR when it's ready. Closing this on our end.

@albertomurillo
Copy link
Author

@albertomurillo Please re-submit the PR when it's ready. Closing this on our end.

Can’t rework due to AGPL license change.

I hope someone else takes over the patch.

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

Successfully merging this pull request may close these issues.

Missing support for credential_process
3 participants