Skip to content

Commit

Permalink
A0CLI-49: add initial custom-domains support.
Browse files Browse the repository at this point in the history
  • Loading branch information
rene00 committed Jan 27, 2021
1 parent 0cdd7f0 commit f404a7b
Show file tree
Hide file tree
Showing 8 changed files with 652 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var requiredScopes = []string{
"create:rules", "delete:rules", "read:rules", "update:rules",
"read:client_keys", "read:logs",
"create:roles", "delete:roles", "read:roles", "update:roles",
"create:custom_domains", "delete:custom_domains", "read:custom_domains", "update:custom_domains",
}

type Authenticator struct {
Expand Down
2 changes: 2 additions & 0 deletions internal/auth0/auth0.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type API struct {
Rule RuleAPI
ResourceServer ResourceServerAPI
Role RoleAPI
CustomDomain CustomDomainAPI
}

func NewAPI(m *management.Management) *API {
Expand All @@ -30,6 +31,7 @@ func NewAPI(m *management.Management) *API {
ResourceServer: m.ResourceServer,
Rule: m.Rule,
Role: m.Role,
CustomDomain: m.CustomDomain,
}
}

Expand Down
22 changes: 22 additions & 0 deletions internal/auth0/custom_domain.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//go:generate mockgen -source=custom_domain.go -destination=custom_domain_mock.go -package=auth0

package auth0

import "gopkg.in/auth0.v5/management"

type CustomDomainAPI interface {
// Create a new custom domain.
Create(r *management.CustomDomain, opts ...management.RequestOption) (err error)

// Retrieve a custom domain configuration and status.
Read(id string, opts ...management.RequestOption) (c *management.CustomDomain, err error)

// Run the verification process on a custom domain.
Verify(id string, opts ...management.RequestOption) (c *management.CustomDomain, err error)

// Delete a custom domain and stop serving requests for it.
Delete(id string, opts ...management.RequestOption) (err error)

// List all custom domains.
List(opts ...management.RequestOption) (c []*management.CustomDomain, err error)
}
131 changes: 131 additions & 0 deletions internal/auth0/custom_domain_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f404a7b

Please sign in to comment.