Skip to content

Commit

Permalink
Updated environment token name in provider
Browse files Browse the repository at this point in the history
  • Loading branch information
roshan8 committed Sep 17, 2020
1 parent 4746f94 commit c1adacf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ TODO

### Squadcast personal refresh token
You will need to create a [personal refresh token](https://app.squadcast.com)
Once the token has been created, it must be exported in your environment as `SQUADCAST_REFRESH_TOKEN`.
Once the token has been created, it must be exported in your environment as `squadcast_token`.

6 changes: 3 additions & 3 deletions squadcast/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ func Provider() terraform.ResourceProvider {
p := &schema.Provider{
Schema: map[string]*schema.Schema{

"refresh_token": {
"squadcast_token": {
Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("SQUADCAST_TOKEN", nil),
DefaultFunc: schema.EnvDefaultFunc("squadcast_token", nil),
},
},

Expand Down Expand Up @@ -54,7 +54,7 @@ func Provider() terraform.ResourceProvider {

func providerConfigure(d *schema.ResourceData) (interface{}, error) {

refreshToken := d.Get("refresh_token").(string)
refreshToken := d.Get("squadcast_token").(string)

if refreshToken != "" {
token, err := GetAccessToken(refreshToken)
Expand Down
4 changes: 2 additions & 2 deletions squadcast/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestProvider_impl(t *testing.T) {
}

func testAccPreCheck(t *testing.T) {
if v := os.Getenv("squadcast_refresh_token"); v == "" {
t.Fatal("squadcast_refresh_token must be set for acceptance tests")
if v := os.Getenv("squadcast_token"); v == "" {
t.Fatal("squadcast_token must be set for acceptance tests")
}
}

0 comments on commit c1adacf

Please sign in to comment.