Skip to content

Commit

Permalink
Reorganize project layout (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught authored Aug 1, 2022
1 parent 382f189 commit e8bb305
Show file tree
Hide file tree
Showing 191 changed files with 103 additions and 102 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ available resources.

## Usage

You can find examples on usage under the [example](example) folder.
You can find examples on usage under the [examples](examples) folder.

[[table of contents]](#table-of-contents)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package auth0
package provider

import (
"fmt"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"

"github.com/auth0/terraform-provider-auth0/auth0/internal/template"
"github.com/auth0/terraform-provider-auth0/internal/template"
)

const testAccDataClientConfigByName = `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"fmt"
Expand All @@ -7,7 +7,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"

"github.com/auth0/terraform-provider-auth0/auth0/internal/template"
"github.com/auth0/terraform-provider-auth0/internal/template"
)

const testAccDataTenantConfig = `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"encoding/json"
Expand All @@ -16,7 +16,7 @@ import (
)

const (
recordingsDIR = "testdata/recordings/"
recordingsDIR = "./../../test/data/recordings/"
recordingsDomain = "terraform-provider-auth0-dev.eu.auth0.com"
)

Expand Down
6 changes: 3 additions & 3 deletions auth0/provider.go → internal/provider/provider.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand All @@ -14,8 +14,8 @@ import (
"github.com/auth0/terraform-provider-auth0/version"
)

// Provider returns a *schema.Provider.
func Provider() *schema.Provider {
// New returns a *schema.Provider.
func New() *schema.Provider {
provider := &schema.Provider{
Schema: map[string]*schema.Schema{
"domain": {
Expand Down
10 changes: 5 additions & 5 deletions auth0/provider_test.go → internal/provider/provider_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand All @@ -20,7 +20,7 @@ import (
func testProviders(httpRecorder *recorder.Recorder) map[string]func() (*schema.Provider, error) {
return map[string]func() (*schema.Provider, error){
"auth0": func() (*schema.Provider, error) {
provider := Provider()
provider := New()

provider.ConfigureContextFunc = configureTestProvider(httpRecorder)

Expand Down Expand Up @@ -101,7 +101,7 @@ func TestMain(m *testing.M) {
}

func TestProvider(t *testing.T) {
if err := Provider().InternalValidate(); err != nil {
if err := New().InternalValidate(); err != nil {
t.Fatal(err)
}
}
Expand All @@ -122,7 +122,7 @@ func TestProvider_debugDefaults(t *testing.T) {
_ = os.Setenv("AUTH0_DEBUG", value)
}

p := Provider()
p := New()
debug, err := p.Schema["debug"].DefaultValue()
if err != nil {
t.Fatalf("Unexpected error: %v", err)
Expand Down Expand Up @@ -199,7 +199,7 @@ func TestProvider_configValidation(t *testing.T) {
for _, test := range testCases {
t.Run(test.name, func(t *testing.T) {
config := terraform.NewResourceConfigRaw(test.resourceConfig)
provider := Provider()
provider := New()

errs := provider.Validate(config)
assertErrorsSliceEqual(t, test.expectedErrors, errs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"fmt"
Expand All @@ -12,7 +12,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/stretchr/testify/assert"

"github.com/auth0/terraform-provider-auth0/auth0/internal/template"
"github.com/auth0/terraform-provider-auth0/internal/template"
)

const testAccActionConfigCreate = `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand All @@ -12,7 +12,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"

internalValidation "github.com/auth0/terraform-provider-auth0/auth0/internal/validation"
internalValidation "github.com/auth0/terraform-provider-auth0/internal/validation"
)

func newClient() *schema.Resource {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package auth0
package provider

import (
"fmt"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"

"github.com/auth0/terraform-provider-auth0/auth0/internal/template"
"github.com/auth0/terraform-provider-auth0/internal/template"
)

func TestAccClientGrant(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"fmt"
Expand All @@ -11,7 +11,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"

"github.com/auth0/terraform-provider-auth0/auth0/internal/template"
"github.com/auth0/terraform-provider-auth0/internal/template"
)

func init() {
Expand Down Expand Up @@ -585,7 +585,7 @@ const testAccClientConfigWithRefreshToken = `
resource "auth0_client" "my_client" {
name = "Acceptance Test - Refresh Token - {{.testName}}"
app_type = "spa"
refresh_token {
rotation_type = "non-rotating"
expiration_type = "non-expiring"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand All @@ -12,7 +12,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"

"github.com/auth0/terraform-provider-auth0/auth0/internal/template"
"github.com/auth0/terraform-provider-auth0/internal/template"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"fmt"
Expand All @@ -9,7 +9,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"

"github.com/auth0/terraform-provider-auth0/auth0/internal/template"
"github.com/auth0/terraform-provider-auth0/internal/template"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"fmt"
Expand All @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"

"github.com/auth0/terraform-provider-auth0/auth0/internal/template"
"github.com/auth0/terraform-provider-auth0/internal/template"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package auth0
package provider

import (
"context"
Expand Down
Loading

0 comments on commit e8bb305

Please sign in to comment.