Skip to content

Commit

Permalink
r/api_management_auth_server: making auth_methods required
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Mar 29, 2019
1 parent 029b038 commit dd0958a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
38 changes: 19 additions & 19 deletions azurerm/resource_arm_api_management_authorization_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ func resourceArmApiManagementAuthorizationServer() *schema.Resource {
Required: true,
ValidateFunc: validate.NoEmptyStrings,
},

"authorization_methods": {
Type: schema.TypeSet,
Required: true,
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: validation.StringInSlice([]string{
string(apimanagement.DELETE),
string(apimanagement.GET),
string(apimanagement.HEAD),
string(apimanagement.OPTIONS),
string(apimanagement.PATCH),
string(apimanagement.POST),
string(apimanagement.PUT),
string(apimanagement.TRACE),
}, false),
},
Set: schema.HashString,
},

"client_id": {
Type: schema.TypeString,
Expand Down Expand Up @@ -70,25 +89,6 @@ func resourceArmApiManagementAuthorizationServer() *schema.Resource {
},

// Optional
"authorization_methods": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: validation.StringInSlice([]string{
string(apimanagement.DELETE),
string(apimanagement.GET),
string(apimanagement.HEAD),
string(apimanagement.OPTIONS),
string(apimanagement.PATCH),
string(apimanagement.POST),
string(apimanagement.PUT),
string(apimanagement.TRACE),
}, false),
},
Set: schema.HashString,
},

"bearer_token_sending_methods": {
Type: schema.TypeSet,
Optional: true,
Expand Down
12 changes: 6 additions & 6 deletions website/docs/r/api_management_authorization_server.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ resource "azurerm_api_management_authorization_server" "example" {

The following arguments are supported:

* `name` - (Required) The name of this Authorization Server. Changing this forces a new resource to be created.

* `api_management_name` - (Required) The name of the API Management Service in which this Authorization Server should be created. Changing this forces a new resource to be created.

* `resource_group_name` - (Required) The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
* `authorization_methods` - (Required) The HTTP Verbs supported by the Authorization Endpoint. Possible values are `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT` and `TRACE`.

-> **NOTE:** `GET` must always be present.

* `authorization_endpoint` - (Required) The OAUTH Authorization Endpoint.

Expand All @@ -55,11 +55,11 @@ The following arguments are supported:

* `grant_types` - (Required) Form of Authorization Grants required when requesting an Access Token. Possible values are `authorizationCode`, `clientCredentials`, `implicit` and `resourceOwnerPassword`.

---
* `name` - (Required) The name of this Authorization Server. Changing this forces a new resource to be created.

* `authorization_methods` - (Optional) The HTTP Verbs supported by the Authorization Endpoint. Possible values are `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT` and `TRACE`.
* `resource_group_name` - (Required) The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

-> **NOTE:** If set, `GET` must always be present.
---

* `bearer_token_sending_methods` - (Optional) The mechanism by which Access Tokens are passed to the API. Possible values are `authorizationHeader` and `query`.

Expand Down

0 comments on commit dd0958a

Please sign in to comment.