Skip to content

Commit 9ff52f2

Browse files
authored
fix example and readme docs (#12)
1 parent a3dd86f commit 9ff52f2

File tree

9 files changed

+25
-22
lines changed

9 files changed

+25
-22
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Overview
44
terraform-provider-curl2 is designed to help make HTTP(s) requests,
55
with additional support for providing JSON bodies and authentication headers.
6+
It also has data sources that help to get the access token from azure ad, auth0.
67

78
* [Curl2 Provider Documentation](https://registry.terraform.io/providers/mehulgohil/curl2/latest/docs)
89

@@ -14,6 +15,8 @@ This enables you to send structured data to the API endpoints.
1415
3. Authentication Headers: The custom provider supports the inclusion of authentication headers in the HTTP requests.
1516
You can provide headers like API keys, tokens, or other authentication mechanisms required by the API.
1617
4. Custom Headers: The custom provider supports the inclusion of custom additional headers in the HTTP requests.
18+
5. Azure AD Token Data Source: Get token from Azure AD.
19+
6. Auth0 Token Data Source: Get token from Auth0.
1720

1821
Azure AD Token DataSource:
1922
This data source helps you to get the token via client credential flow.
@@ -25,7 +28,7 @@ terraform {
2528
required_providers {
2629
curl2 = {
2730
source = "mehulgohil/curl2"
28-
version = "1.6.0"
31+
version = "1.6.1"
2932
}
3033
}
3134
}

curl2/provider.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (c *curl2Provider) Metadata(_ context.Context, _ provider.MetadataRequest,
5656
// Schema defines the provider-level schema for configuration data.
5757
func (c *curl2Provider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) {
5858
resp.Schema = schema.Schema{
59-
Description: "Triggers HTTP(s) requests along with JSON body, authentication as well as custom headers",
59+
Description: "Triggers HTTP(s) requests along with JSON body, authentication as well as custom headers. It also supports token generation from IDP like Azure AD, Auth0.",
6060
Attributes: map[string]schema.Attribute{
6161
"disable_tls": schema.BoolAttribute{
6262
Optional: true,
@@ -89,15 +89,15 @@ func (c *curl2Provider) Schema(_ context.Context, _ provider.SchemaRequest, resp
8989
Description: "Azure AD Configuration which is required if you are using `curl2_azuread_token` data",
9090
Attributes: map[string]schema.Attribute{
9191
"client_id": schema.StringAttribute{
92-
Description: "Application ID of an Azure service principal. You can also set is as ENV variable `AZURE_CLIENT_ID`",
92+
Description: "Application ID of an Azure service principal. You can also set it as ENV variable `AZURE_CLIENT_ID`",
9393
Optional: true,
9494
},
9595
"client_secret": schema.StringAttribute{
96-
Description: "Password of the Azure service principal. You can also set is as ENV variable `AZURE_CLIENT_SECRET`",
96+
Description: "Password of the Azure service principal. You can also set it as ENV variable `AZURE_CLIENT_SECRET`",
9797
Optional: true,
9898
},
9999
"tenant_id": schema.StringAttribute{
100-
Description: "ID of the application's Azure AD tenant. You can also set is as ENV variable `AZURE_TENANT_ID`",
100+
Description: "ID of the application's Azure AD tenant. You can also set it as ENV variable `AZURE_TENANT_ID`",
101101
Optional: true,
102102
},
103103
},
@@ -106,15 +106,15 @@ func (c *curl2Provider) Schema(_ context.Context, _ provider.SchemaRequest, resp
106106
Description: "Auth0 Configuration which is required if you are using `curl2_auth0_token` data",
107107
Attributes: map[string]schema.Attribute{
108108
"client_id": schema.StringAttribute{
109-
Description: "Application's Client ID. You can also set is as ENV variable `AUTH0_CLIENT_ID`",
109+
Description: "Application's Client ID. You can also set it as ENV variable `AUTH0_CLIENT_ID`",
110110
Optional: true,
111111
},
112112
"client_secret": schema.StringAttribute{
113-
Description: "Application's Client Secret. You can also set is as ENV variable `AUTH0_CLIENT_SECRET`",
113+
Description: "Application's Client Secret. You can also set it as ENV variable `AUTH0_CLIENT_SECRET`",
114114
Optional: true,
115115
},
116116
"domain": schema.StringAttribute{
117-
Description: "Auth0 domain URL in the format `https://<your-tenant-name>.auth0.com`. You can also set is as ENV variable `AUTH0_DOMAIN`",
117+
Description: "Auth0 domain URL in the format `https://<your-tenant-name>.auth0.com`. You can also set it as ENV variable `AUTH0_DOMAIN`",
118118
Optional: true,
119119
},
120120
},

docs/data-sources/auth0_token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ terraform {
1717
required_providers {
1818
curl2 = {
1919
source = "mehulgohil/curl2"
20-
version = "1.6.0"
20+
version = "1.6.1"
2121
}
2222
}
2323
}

docs/data-sources/azuread_token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ terraform {
1717
required_providers {
1818
curl2 = {
1919
source = "mehulgohil/curl2"
20-
version = "1.5.0"
20+
version = "1.6.1"
2121
}
2222
}
2323
}

docs/data-sources/curl2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ terraform {
1717
required_providers {
1818
curl2 = {
1919
source = "mehulgohil/curl2"
20-
version = "1.6.0"
20+
version = "1.6.1"
2121
}
2222
}
2323
}

docs/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
page_title: "curl2 Provider"
44
subcategory: ""
55
description: |-
6-
Triggers HTTP(s) requests along with JSON body, authentication as well as custom headers
6+
Triggers HTTP(s) requests along with JSON body, authentication as well as custom headers. It also supports token generation from IDP like Azure AD, Auth0.
77
---
88

99
# curl2 Provider
1010

11-
Triggers HTTP(s) requests along with JSON body, authentication as well as custom headers
11+
Triggers HTTP(s) requests along with JSON body, authentication as well as custom headers. It also supports token generation from IDP like Azure AD, Auth0.
1212

1313
## Example Usage
1414

@@ -61,19 +61,19 @@ provider "curl2" {
6161

6262
Optional:
6363

64-
- `client_id` (String) Application's Client ID. You can also set is as ENV variable `AUTH0_CLIENT_ID`
65-
- `client_secret` (String) Application's Client Secret. You can also set is as ENV variable `AUTH0_CLIENT_SECRET`
66-
- `domain` (String) Auth0 domain URL in the format `https://<your-tenant-name>.auth0.com`. You can also set is as ENV variable `AUTH0_DOMAIN`
64+
- `client_id` (String) Application's Client ID. You can also set it as ENV variable `AUTH0_CLIENT_ID`
65+
- `client_secret` (String) Application's Client Secret. You can also set it as ENV variable `AUTH0_CLIENT_SECRET`
66+
- `domain` (String) Auth0 domain URL in the format `https://<your-tenant-name>.auth0.com`. You can also set it as ENV variable `AUTH0_DOMAIN`
6767

6868

6969
<a id="nestedblock--azure_ad"></a>
7070
### Nested Schema for `azure_ad`
7171

7272
Optional:
7373

74-
- `client_id` (String) Application ID of an Azure service principal. You can also set is as ENV variable `AZURE_CLIENT_ID`
75-
- `client_secret` (String) Password of the Azure service principal. You can also set is as ENV variable `AZURE_CLIENT_SECRET`
76-
- `tenant_id` (String) ID of the application's Azure AD tenant. You can also set is as ENV variable `AZURE_TENANT_ID`
74+
- `client_id` (String) Application ID of an Azure service principal. You can also set it as ENV variable `AZURE_CLIENT_ID`
75+
- `client_secret` (String) Password of the Azure service principal. You can also set it as ENV variable `AZURE_CLIENT_SECRET`
76+
- `tenant_id` (String) ID of the application's Azure AD tenant. You can also set it as ENV variable `AZURE_TENANT_ID`
7777

7878

7979
<a id="nestedblock--retry"></a>

examples/data-sources/curl2/data-source.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
curl2 = {
44
source = "mehulgohil/curl2"
5-
version = "1.6.0"
5+
version = "1.6.1"
66
}
77
}
88
}

examples/data-sources/curl2_auth0_token/data-source.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
curl2 = {
44
source = "mehulgohil/curl2"
5-
version = "1.6.0"
5+
version = "1.6.1"
66
}
77
}
88
}

examples/data-sources/curl2_azuread_token/data-source.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
curl2 = {
44
source = "mehulgohil/curl2"
5-
version = "1.5.0"
5+
version = "1.6.1"
66
}
77
}
88
}

0 commit comments

Comments
 (0)