Skip to content

Commit

Permalink
Merge pull request #873 from hashicorp/netramali/remove-beta-flags
Browse files Browse the repository at this point in the history
Remove OAuth Client Beta Flag
  • Loading branch information
netramali committed Apr 22, 2024
2 parents d5f3f1d + 919d2bb commit 9b81220
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
8 changes: 1 addition & 7 deletions oauth_client.go
Expand Up @@ -90,15 +90,12 @@ type OAuthClient struct {
Secret string `jsonapi:"attr,secret"`
ServiceProvider ServiceProviderType `jsonapi:"attr,service-provider"`
ServiceProviderName string `jsonapi:"attr,service-provider-display-name"`
// **Note: This field is still in BETA and subject to change.**
OrganizationScoped *bool `jsonapi:"attr,organization-scoped"`
OrganizationScoped *bool `jsonapi:"attr,organization-scoped"`

// Relations
Organization *Organization `jsonapi:"relation,organization"`
OAuthTokens []*OAuthToken `jsonapi:"relation,oauth-tokens"`
AgentPool *AgentPool `jsonapi:"relation,agent-pool"`

// **Note: This field is still in BETA and subject to change.**
// The projects to which the oauth client applies.
Projects []*Project `jsonapi:"relation,projects"`
}
Expand Down Expand Up @@ -151,7 +148,6 @@ type OAuthClientCreateOptions struct {
// Optional: The token string you were given by your VCS provider.
OAuthToken *string `jsonapi:"attr,oauth-token-string,omitempty"`

// **Note: This field is still in BETA and subject to change.**
// Optional: The initial list of projects for which the oauth client should be associated with.
Projects []*Project `jsonapi:"relation,projects,omitempty"`

Expand All @@ -171,7 +167,6 @@ type OAuthClientCreateOptions struct {
// Optional: AgentPool to associate the VCS Provider with, for PrivateVCS support
AgentPool *AgentPool `jsonapi:"relation,agent-pool,omitempty"`

// **Note: This field is still in BETA and subject to change.**
// Optional: Whether the OAuthClient is available to all workspaces in the organization.
// True if the oauth client is organization scoped, false otherwise.
OrganizationScoped *bool `jsonapi:"attr,organization-scoped,omitempty"`
Expand Down Expand Up @@ -201,7 +196,6 @@ type OAuthClientUpdateOptions struct {
// Optional: The token string you were given by your VCS provider.
OAuthToken *string `jsonapi:"attr,oauth-token-string,omitempty"`

// **Note: This field is still in BETA and subject to change.**
// Optional: Whether the OAuthClient is available to all workspaces in the organization.
// True if the oauth client is organization scoped, false otherwise.
OrganizationScoped *bool `jsonapi:"attr,organization-scoped,omitempty"`
Expand Down
22 changes: 0 additions & 22 deletions oauth_client_integration_test.go
Expand Up @@ -175,24 +175,6 @@ func TestOAuthClientsCreate(t *testing.T) {
_, err := client.OAuthClients.Create(ctx, orgTest.Name, options)
assert.Equal(t, err, ErrRequiredServiceProvider)
})

t.Run("with projects provided", func(t *testing.T) {
skipUnlessBeta(t)
prjTest, prjTestCleanup := createProject(t, client, orgTest)
defer prjTestCleanup()

options := OAuthClientCreateOptions{
Name: String("project-oauth-client"),
Projects: []*Project{prjTest},
}

ps, err := client.OAuthClients.Create(ctx, orgTest.Name, options)
require.NoError(t, err)

assert.Equal(t, ps.Name, *options.Name)
assert.Equal(t, len(ps.Projects), 1)
assert.Equal(t, ps.Projects[0].ID, prjTest.ID)
})
}

func TestOAuthClientsCreate_rsaKeyPair(t *testing.T) {
Expand Down Expand Up @@ -330,7 +312,6 @@ func TestOAuthClientsRead(t *testing.T) {
}

func TestOAuthClientsReadWithOptions(t *testing.T) {
skipUnlessBeta(t)
client := testClient(t)
ctx := context.Background()

Expand Down Expand Up @@ -499,7 +480,6 @@ func TestOAuthClientsCreateOptionsValid(t *testing.T) {
}

func TestOAuthClientsAddProjects(t *testing.T) {
skipUnlessBeta(t)
client := testClient(t)
ctx := context.Background()

Expand Down Expand Up @@ -569,7 +549,6 @@ func TestOAuthClientsAddProjects(t *testing.T) {
}

func TestOAuthClientsRemoveProjects(t *testing.T) {
skipUnlessBeta(t)
client := testClient(t)
ctx := context.Background()

Expand Down Expand Up @@ -633,7 +612,6 @@ func TestOAuthClientsRemoveProjects(t *testing.T) {
}

func TestOAuthClientsUpdate(t *testing.T) {
skipUnlessBeta(t)
client := testClient(t)
ctx := context.Background()

Expand Down

0 comments on commit 9b81220

Please sign in to comment.