-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.5.0-rc4: initial support for ovh, provider generator implementatio…
…n update, replaced all interface{} to any
- Loading branch information
yusing
committed
Sep 17, 2024
1 parent
82f0637
commit 21fcceb
Showing
21 changed files
with
286 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
go 1.22 | ||
go 1.22.0 | ||
|
||
toolchain go1.23.1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package provider_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/go-acme/lego/v4/providers/dns/ovh" | ||
. "github.com/yusing/go-proxy/utils" | ||
"gopkg.in/yaml.v3" | ||
) | ||
|
||
// type Config struct { | ||
// APIEndpoint string | ||
|
||
// ApplicationKey string | ||
// ApplicationSecret string | ||
// ConsumerKey string | ||
|
||
// OAuth2Config *OAuth2Config | ||
|
||
// PropagationTimeout time.Duration | ||
// PollingInterval time.Duration | ||
// TTL int | ||
// HTTPClient *http.Client | ||
// } | ||
|
||
func TestOVH(t *testing.T) { | ||
cfg := &ovh.Config{} | ||
testYaml := ` | ||
api_endpoint: https://eu.api.ovh.com | ||
application_key: <application_key> | ||
application_secret: <application_secret> | ||
consumer_key: <consumer_key> | ||
oauth2_config: | ||
client_id: <client_id> | ||
client_secret: <client_secret> | ||
` | ||
cfgExpected := &ovh.Config{ | ||
APIEndpoint: "https://eu.api.ovh.com", | ||
ApplicationKey: "<application_key>", | ||
ApplicationSecret: "<application_secret>", | ||
ConsumerKey: "<consumer_key>", | ||
OAuth2Config: &ovh.OAuth2Config{ClientID: "<client_id>", ClientSecret: "<client_secret>"}, | ||
} | ||
testYaml = testYaml[1:] // remove first \n | ||
opt := make(map[string]any) | ||
ExpectNoError(t, yaml.Unmarshal([]byte(testYaml), opt)) | ||
ExpectNoError(t, Deserialize(opt, cfg)) | ||
ExpectEqual(t, cfg, cfgExpected) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.