-
Notifications
You must be signed in to change notification settings - Fork 101
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 Name to the Oauth Client Payload #466
Conversation
95c75bf
to
d1b630f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really minor ⬇️ . Don't forget to include a changelog entry and given the OAuthClient interface has changed, you'll want to run ./generate_mocks.sh
.
oauth_client.go
Outdated
@@ -73,6 +73,7 @@ type OAuthClient struct { | |||
HTTPURL string `jsonapi:"attr,http-url"` | |||
Key string `jsonapi:"attr,key"` | |||
RSAPublicKey string `jsonapi:"attr,rsa-public-key"` | |||
Name string `jsonapi:"attr,name"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the default value of this field is null
, we should make this a pointer.
oauth_client_integration_test.go
Outdated
@@ -109,6 +109,7 @@ func TestOAuthClientsCreate(t *testing.T) { | |||
oc, err := client.OAuthClients.Create(ctx, orgTest.Name, options) | |||
require.NoError(t, err) | |||
assert.NotEmpty(t, oc.ID) | |||
assert.Empty(t, oc.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert.Nil()
💅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice - when I make Name a pointer it does actually come through as null
rather than ""
.
d1b630f
to
1a4f8aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍 -- I was incorrect though, you only need to regenerate mocks when a method signature changes.
Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes. |
Description
The oauth-clients endpoint returns the name attribute of each OAuth Client, but the OAuthClient struct doesn't expose this attribute. This pull request adds the Name field to the OAuthClient struct.
Fixes #461
Testing plan
This is how you see the name in the Oauth Client payload:
In order to run the integration test you also need to do the first two steps from above.
External links
Output from tests
Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.