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

[v1] identity: use AuthOptionsBuilder for v2 auth #3030

Open
wants to merge 1 commit into
base: v1
Choose a base branch
from

Conversation

cardoe
Copy link
Contributor

@cardoe cardoe commented Apr 14, 2024

Rather than creating a tokens2.AuthOptions inside the authentication flow for identity v2, allow any structure that implements the tokens2.AuthBuilderOptions interface to be used. The gophercloud.AuthOptions already implements this interface so there is no change to the API. To avoid any API change, add AuthenticateV2Ext() as a version of AuthenticateV2() accepting the interface. This will allow an out of tree identity v2 auth mechanism to be implemented, just like the v3. fixes #2651. ref #1330.

@cardoe
Copy link
Contributor Author

cardoe commented Apr 14, 2024

I believe this is a compatible implementation of #2655 that is not a major version breaking change. The CanReauth() call is probably the better approach but that's a major break which I've left in #2655.

@github-actions github-actions bot added the semver:minor Backwards-compatible change label Apr 14, 2024
@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Apr 14, 2024
@coveralls
Copy link

coveralls commented Apr 14, 2024

Coverage Status

coverage: 77.914% (-0.04%) from 77.955%
when pulling 92421bd on cardoe:go-v1-fix-auth-v2
into fab2a6e on gophercloud:v1.

@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Apr 14, 2024
Rather than creating a tokens2.AuthOptions inside the authentication
flow for identity v2, allow any structure that implements the
tokens2.AuthBuilderOptions interface to be used. The
gophercloud.AuthOptions already implements this interface so there
is no change to the API. To avoid any API change, add
AuthenticateV2Ext() as a version of AuthenticateV2() accepting the
interface. This will allow an out of tree identity v2 auth mechanism
to be implemented, just like the v3. fixes gophercloud#2651. ref gophercloud#1330.
@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Apr 14, 2024
@cardoe
Copy link
Contributor Author

cardoe commented Apr 14, 2024

I've implemented https://github.com/rackerlabs/goraxauth using this and verified that it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor Backwards-compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants