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

Fix incorrect OpenAPI operation ID #21543

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

maxb
Copy link
Contributor

@maxb maxb commented Jul 1, 2023

The operation ID for GET auth/token/lookup has been overridden in
a way which implies it can only perform lookup-self operations.

This isn't actually the case, as shown:

  1. Here is my current token:
$ vault read -field=display_name auth/token/lookup
userpass-admin
  1. I create a second token, with a different display name to distinguish
    it:
$ othertoken=$(vault token create -field=token -display-name=testing123)
  1. I use this operation, still authenticated with the first token, to
    lookup the second token, showing it is not actually a lookup-self operation:
$ vault read -field=display_name auth/token/lookup token=$othertoken
token-testing123

I have set the new operation ID suffix to "2" adhering to current
conventions in vault-client-go and vault-client-dotnet for secondary
versions of APIs which should be excluded from the generated library
code.

I have confirmed this doesn't give rise to any new clashes between operation IDs.

The operation ID for `GET auth/token/lookup` has been overridden in
a way which *implies* it can only perform lookup-self operations.

This is not true, as shown:

1) Here is my current token:
```
$ vault read -field=display_name auth/token/lookup
userpass-admin
```

2) I create a second token, with a different display name to distinguish
   it:
```
$ othertoken=$(vault token create -field=token -display-name=testing123)
```

3) I use this operation, still authenticated with the first token, to
   lookup the second token, proving it does not have lookup-self nature:
```
$ vault read -field=display_name auth/token/lookup token=$othertoken
token-testing123
```

I have set the new operation ID suffix to `"2"` adhering to current
conventions in `vault-client-go` and `vault-client-dotnet` for secondary
versions of APIs which should be excluded from the generated library
code.
@maxb
Copy link
Contributor Author

maxb commented Jul 1, 2023

Hi @averche,

I figure you would be the best reviewer for this change, as it touches an ID you introduced in #19399.

I propose this is trivial enough for pr/no-changelog.

Thanks,
Max.

Copy link
Contributor

@averche averche left a comment

Choose a reason for hiding this comment

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

Thanks again for contributing! Looks good to me!

@averche averche merged commit c9b18c4 into hashicorp:main Jul 4, 2023
@maxb maxb deleted the fix-incorrect-openapi-operation-id branch July 13, 2023 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants