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

Added "Domain" configuration parameter to Swift provider to enable V3 authentication #2554

Merged
merged 3 commits into from
Apr 17, 2017

Conversation

mevansam
Copy link
Contributor

@mevansam mevansam commented Apr 2, 2017

This pull request adds the ability to pass in the Keystone user and project domains which is required by OpenStack environments configured with v3 auth.

@mevansam mevansam changed the title Added "Domain Added "Domain" configuration parameter to Swift provider to enable V3 authentication Apr 2, 2017
if domain == "" {
domain = conf["domain"]
}
tenantDomain := os.Getenv("OS_PROJECT_DOMAIN_NAME")
Copy link
Member

Choose a reason for hiding this comment

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

Why the tenant/project mismatch here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a quirk that the OpenStack project introduced with KeyStone V3. Originally a KeyStone project was called a tenant and that naming was deprecated several releases ago. However, a lot of clients maintain the name "tenant" internally. I kept this name as the underlying "github.com/ncw/swift library still uses the old naming for projects. For the environment variable, I used the name that is required by the most recent versions of the OpenStack CLIs authenticating with KeyStone V3 API as this would present in most users' environments.

Copy link
Member

Choose a reason for hiding this comment

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

Given that this is new stuff, it feels like the conf "tenant-domain" should use "project-domain" if the old nomenclature was deprecated several releases ago. Sound reasonable?

@jefferai jefferai added this to the 0.7.1 milestone Apr 4, 2017
…and its domain and at the same time maintain backward compatibility with the nomenclature prior to KeyStone v3.
Copy link
Contributor Author

@mevansam mevansam left a comment

Choose a reason for hiding this comment

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

I updated the logic to look for OS_PROJECT along with OS_PROJECT_DOMAIN_NAME. This makes it consistent with the new nomenclature. I also renamed the internal variable names. Unfortunately, the underlying ncw swift API client still maintains the tenant naming instead of project but the code should be consistent with the environment expected by the openstack CLI.

@jefferai
Copy link
Member

@mevansam Looks good!

@jefferai jefferai merged commit 2cc41a7 into hashicorp:master Apr 17, 2017
chrishoffman pushed a commit that referenced this pull request Apr 18, 2017
* oss/master:
  Fix azure test round 2
  Fix test for changed Azure
  changelog++
  Add -self flag to token-revoke (#2596)
  Update revoke.html.md (#2604)
  Update to new Azure code after dep update (#2603)
  changelog++
  Added "Domain" configuration parameter to Swift provider to enable V3 authentication (#2554)
  Fix cassandra dep breakage
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