@@ -135,15 +135,25 @@ func Provider() *schema.Provider {
135
135
Description : "Configuration for oauth client credential flow using the https://pkg.go.dev/golang.org/x/oauth2 implementation" ,
136
136
Elem : & schema.Resource {
137
137
Schema : map [string ]* schema.Schema {
138
+ "oauth_client_id_environment_variable" : {
139
+ Type : schema .TypeString ,
140
+ Description : "Name of client id environment variable, when using an environment variable to specify the client id" ,
141
+ Optional : true ,
142
+ },
143
+ "oauth_client_secret_environment_variable" : {
144
+ Type : schema .TypeString ,
145
+ Description : "Name of client secret environment variable, when using an environment variable to specify the client id" ,
146
+ Optional : true ,
147
+ },
138
148
"oauth_client_id" : {
139
149
Type : schema .TypeString ,
140
150
Description : "client id" ,
141
- Required : true ,
151
+ Optional : true ,
142
152
},
143
153
"oauth_client_secret" : {
144
154
Type : schema .TypeString ,
145
155
Description : "client secret" ,
146
- Required : true ,
156
+ Optional : true ,
147
157
},
148
158
"oauth_token_endpoint" : {
149
159
Type : schema .TypeString ,
@@ -214,6 +224,7 @@ func Provider() *schema.Provider {
214
224
"restapi_object" : dataSourceRestAPI (),
215
225
},
216
226
ConfigureFunc : configureProvider ,
227
+
217
228
}
218
229
}
219
230
@@ -267,6 +278,8 @@ func configureProvider(d *schema.ResourceData) (interface{}, error) {
267
278
if v , ok := d .GetOk ("oauth_client_credentials" ); ok {
268
279
oauthConfig := v .([]interface {})[0 ].(map [string ]interface {})
269
280
281
+ opt .oauthClientIDEnvVar = oauthConfig ["oauth_client_id_environment_variable" ].(string )
282
+ opt .oauthClientSecretEnvVar = oauthConfig ["oauth_client_secret_environment_variable" ].(string )
270
283
opt .oauthClientID = oauthConfig ["oauth_client_id" ].(string )
271
284
opt .oauthClientSecret = oauthConfig ["oauth_client_secret" ].(string )
272
285
opt .oauthTokenURL = oauthConfig ["oauth_token_endpoint" ].(string )
0 commit comments