From 1a4f8aa1750e67cfd869c6a87452d60bba25d4f2 Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Fri, 15 Jul 2022 11:38:46 -0500 Subject: [PATCH] Add Name to the Oauth Client Payload Fixes #461 --- CHANGELOG.md | 3 +++ oauth_client.go | 1 + oauth_client_integration_test.go | 1 + 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f49a5a8f..393cae96a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Unreleased +# v1.6.0 +* Add `Name` field to `OAuthClient` by @barrettclark [#466](https://github.com/hashicorp/go-tfe/pull/466) + # v1.5.0 ## Enhancements diff --git a/oauth_client.go b/oauth_client.go index e0034417c..e57d49afb 100644 --- a/oauth_client.go +++ b/oauth_client.go @@ -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"` Secret string `jsonapi:"attr,secret"` ServiceProvider ServiceProviderType `jsonapi:"attr,service-provider"` ServiceProviderName string `jsonapi:"attr,service-provider-display-name"` diff --git a/oauth_client_integration_test.go b/oauth_client_integration_test.go index aad201f01..0175b606b 100644 --- a/oauth_client_integration_test.go +++ b/oauth_client_integration_test.go @@ -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.Nil(t, oc.Name) assert.Equal(t, "https://api.github.com", oc.APIURL) assert.Equal(t, "https://github.com", oc.HTTPURL) assert.Equal(t, 1, len(oc.OAuthTokens))