Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove APIKey #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/lint-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ jobs:
go-version: 1.17
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Test with apikey
env:
GANDI_URL: https://api.sandbox.gandi.net
GANDI_KEY: ${{ secrets.GANDI_SANDBOX_KEY }}
GANDI_SHARING_ID: a2f9c3dc-ab0e-11ee-b064-00163e6722b2
run: |
make testacc
- name: Test with personal access token
env:
GANDI_URL: https://api.sandbox.gandi.net
Expand Down
9 changes: 0 additions & 9 deletions gandi/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ func Provider() *schema.Provider {
Description: "A Gandi API Personal Access Token",
Sensitive: true,
},
"key": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("GANDI_KEY", nil),
Description: "(DEPRECATED) A Gandi API key",
Deprecated: "use personal_access_token instead",
Sensitive: true,
},
"sharing_id": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -84,7 +76,6 @@ type clients struct {
func getGandiClients(d *schema.ResourceData) (interface{}, error) {
config := config.Config{
APIURL: d.Get("url").(string),
APIKey: d.Get("key").(string),
PersonalAccessToken: d.Get("personal_access_token").(string),
SharingID: d.Get("sharing_id").(string),
DryRun: d.Get("dry_run").(bool),
Expand Down
4 changes: 2 additions & 2 deletions gandi/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func TestProvider_impl(t *testing.T) {
}

func testAccPreCheck(t *testing.T) {
if os.Getenv("GANDI_PERSONAL_ACCESS_TOKEN") == "" && os.Getenv("GANDI_KEY") == "" {
t.Fatal("GANDI_PERSONAL_ACCESS_TOKEN or GANDI_KEY must be set for acceptance tests")
if os.Getenv("GANDI_PERSONAL_ACCESS_TOKEN") == "" {
t.Fatal("GANDI_PERSONAL_ACCESS_TOKEN must be set for acceptance tests")
}
if os.Getenv("GANDI_URL") == "" {
t.Fatal("GANDI_URL must be set for acceptance tests")
Expand Down
3 changes: 0 additions & 3 deletions gandi/resource_livedns_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func deleteRecord() {
config := config.Config{
APIURL: os.Getenv("GANDI_URL"),
PersonalAccessToken: os.Getenv("GANDI_PERSONAL_ACCESS_TOKEN"),
APIKey: os.Getenv("GANDI_KEY"),
SharingID: os.Getenv("GANDI_SHARING_ID"),
Debug: logging.IsDebugOrHigher(),
}
Expand Down Expand Up @@ -232,7 +231,6 @@ func updateRecord(values []string) {
config := config.Config{
APIURL: os.Getenv("GANDI_URL"),
PersonalAccessToken: os.Getenv("GANDI_PERSONAL_ACCESS_TOKEN"),
APIKey: os.Getenv("GANDI_KEY"),
SharingID: os.Getenv("GANDI_SHARING_ID"),
Debug: logging.IsDebugOrHigher(),
}
Expand All @@ -252,7 +250,6 @@ func checkRecordValuesOnAPI(state *terraform.State, expected []string) error {
config := config.Config{
APIURL: os.Getenv("GANDI_URL"),
PersonalAccessToken: os.Getenv("GANDI_PERSONAL_ACCESS_TOKEN"),
APIKey: os.Getenv("GANDI_KEY"),
SharingID: os.Getenv("GANDI_SHARING_ID"),
Debug: logging.IsDebugOrHigher(),
}
Expand Down