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

agent: allow AppRole Auto-Auth when bind_secret_id = false #6324

Merged

Conversation

deblasis
Copy link
Contributor

@deblasis deblasis commented Mar 2, 2019

Currently, if you have an AppRole configured with bind_secret_id = false and at least a constraint, you can login with just the role_id.

Vault agent doesn't support this method for Auto-Auth as it expects a mandatory secret_id_file_path.

Changes:

  • This PR makes secret_id_file_path optional.
  • Added unit tests in order to provide coverage for the default/current behaviour and for the new logical branches.
  • Updated docs to reflect the changes

The code should be self-explanatory but there's always room for improvements 😄

I hope to see this merged at some point, I hate maintaining forks 😀

New feature driven by our requirements.
I believe it would be nice to have.
@@ -180,9 +196,6 @@ func (a *approleMethod) Authenticate(ctx context.Context, client *api.Client) (s
}
}

if a.cachedRoleID == "" {
Copy link
Member

Choose a reason for hiding this comment

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

What's the purpose of removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -21,6 +21,7 @@ type approleMethod struct {

roleIDFilePath string
secretIDFilePath string
secretIDLessMode bool
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason you need this bool? Seems like simply checking the path for emptiness should be sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 You are right, PR updated

Copy link
Contributor Author

@deblasis deblasis left a comment

Choose a reason for hiding this comment

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

👍

@@ -180,9 +196,6 @@ func (a *approleMethod) Authenticate(ctx context.Context, client *api.Client) (s
}
}

if a.cachedRoleID == "" {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -21,6 +21,7 @@ type approleMethod struct {

roleIDFilePath string
secretIDFilePath string
secretIDLessMode bool
Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 You are right, PR updated

@jefferai jefferai added this to the 1.1.1 milestone Mar 29, 2019
Copy link
Member

@jefferai jefferai left a comment

Choose a reason for hiding this comment

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

One thing, LGTM otherwise.

@jefferai jefferai merged commit 14138f6 into hashicorp:master Apr 1, 2019
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.

2 participants