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

Bump goauthentik.io/api/v3 from 3.2023106.3 to 3.2023106.5 #464

Merged
merged 2 commits into from
Jan 26, 2024
Merged
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
20 changes: 4 additions & 16 deletions docs/data-sources/tenant.md → docs/data-sources/brand.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
---
page_title: "authentik_tenant Data Source - terraform-provider-authentik"
page_title: "authentik_brand Data Source - terraform-provider-authentik"
subcategory: "System"
description: |-
Get tenants by domain
Get brands by domain
---

# authentik_tenant (Data Source)
# authentik_brand (Data Source)

Get tenants by domain
Get brands by domain

## Example Usage

```terraform
# To get the details of a tenant by domain

data "authentik_tenant" "authentik-default" {
domain = "authentik-default"
}

# Then use `data.authentik_tenant.authentik-default.domain`, `data.authentik_tenant.authentik-default.branding_title`,
# `data.authentik_tenant.authentik-default.branding_logo`, ...
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -32,7 +21,6 @@ data "authentik_tenant" "authentik-default" {
- `branding_title` (String) Generated.
- `default` (Boolean) Generated.
- `domain` (String) Generated.
- `event_retention` (String) Generated.
- `flow_authentication` (String) Generated.
- `flow_device_code` (String) Generated.
- `flow_invalidation` (String) Generated.
Expand Down
15 changes: 2 additions & 13 deletions docs/resources/tenant.md → docs/resources/brand.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
---
page_title: "authentik_tenant Resource - terraform-provider-authentik"
page_title: "authentik_brand Resource - terraform-provider-authentik"
subcategory: "System"
description: |-

---

# authentik_tenant (Resource)
# authentik_brand (Resource)



## Example Usage

```terraform
# Create/manage a default tenant

resource "authentik_tenant" "default" {
domain = "."
default = true
branding_title = "test"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -35,7 +25,6 @@ resource "authentik_tenant" "default" {
- `branding_logo` (String)
- `branding_title` (String) Defaults to `authentik`.
- `default` (Boolean) Defaults to `false`.
- `event_retention` (String) Defaults to `days=365`.
- `flow_authentication` (String)
- `flow_device_code` (String)
- `flow_invalidation` (String)
Expand Down
7 changes: 5 additions & 2 deletions docs/resources/policy_event_matcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ resource "authentik_policy_event_matcher" "name" {

- `action` (String)
- `app` (String) Allowed values:
- `authentik.tenants`
- `authentik.admin`
- `authentik.api`
- `authentik.crypto`
Expand Down Expand Up @@ -78,14 +79,16 @@ resource "authentik_policy_event_matcher" "name" {
- `authentik.stages.user_login`
- `authentik.stages.user_logout`
- `authentik.stages.user_write`
- `authentik.tenants`
- `authentik.brands`
- `authentik.blueprints`
- `authentik.core`
- `authentik.enterprise`
- `authentik.enterprise.audit`
- `authentik.enterprise.providers.rac`
- `client_ip` (String)
- `execution_logging` (Boolean) Defaults to `false`.
- `model` (String) Allowed values:
- `authentik_tenants.domain`
- `authentik_crypto.certificatekeypair`
- `authentik_events.event`
- `authentik_events.notificationtransport`
Expand Down Expand Up @@ -153,7 +156,7 @@ resource "authentik_policy_event_matcher" "name" {
- `authentik_stages_user_login.userloginstage`
- `authentik_stages_user_logout.userlogoutstage`
- `authentik_stages_user_write.userwritestage`
- `authentik_tenants.tenant`
- `authentik_brands.brand`
- `authentik_blueprints.blueprintinstance`
- `authentik_core.group`
- `authentik_core.user`
Expand Down
8 changes: 8 additions & 0 deletions examples/data-sources/authentik_brand/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# To get the details of a brand by domain

data "authentik_brand" "authentik-default" {
domain = "authentik-default"
}

# Then use `data.authentik_brand.authentik-default.domain`, `data.authentik_brand.authentik-default.branding_title`,
# `data.authentik_brand.authentik-default.branding_logo`, ...
8 changes: 0 additions & 8 deletions examples/data-sources/authentik_tenant/data-source.tf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Create/manage a default tenant
# Create/manage a default brand

resource "authentik_tenant" "default" {
resource "authentik_brand" "default" {
domain = "."
default = true
branding_title = "test"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/hashicorp/terraform-plugin-sdk v1.17.2
github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0
github.com/stretchr/testify v1.8.4
goauthentik.io/api/v3 v3.2023106.3
goauthentik.io/api/v3 v3.2023106.5
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ go.opentelemetry.io/otel/sdk v1.17.0 h1:FLN2X66Ke/k5Sg3V623Q7h7nt3cHXaW1FOvKKrW0
go.opentelemetry.io/otel/sdk v1.17.0/go.mod h1:U87sE0f5vQB7hwUoW98pW5Rz4ZDuCFBZFNUBlSgmDFQ=
go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYOdSKWQ=
go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY=
goauthentik.io/api/v3 v3.2023106.3 h1:/ROBnDg6HBNOEyINKdI8pnwiu+ETQfB3MMdjgAoxJ/I=
goauthentik.io/api/v3 v3.2023106.3/go.mod h1:zz+mEZg8rY/7eEjkMGWJ2DnGqk+zqxuybGCGrR2O4Kw=
goauthentik.io/api/v3 v3.2023106.5 h1:ogldINBGXP0J+8DALdqVtHvqhh5ePDMFe22WYczUIks=
goauthentik.io/api/v3 v3.2023106.5/go.mod h1:zz+mEZg8rY/7eEjkMGWJ2DnGqk+zqxuybGCGrR2O4Kw=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

func dataSourceTenant() *schema.Resource {
func dataSourceBrand() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceTenantRead,
Description: "System --- Get tenants by domain",
Description: "System --- Get brands by domain",
Schema: map[string]*schema.Schema{
"domain": {
Type: schema.TypeString,
Expand Down Expand Up @@ -67,11 +67,6 @@
Optional: true,
Computed: true,
},
"event_retention": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"web_certificate": {
Type: schema.TypeString,
Optional: true,
Expand All @@ -85,7 +80,7 @@
var diags diag.Diagnostics
c := m.(*APIClient)

req := c.client.CoreApi.CoreTenantsList(ctx)
req := c.client.CoreApi.CoreBrandsList(ctx)
if s, ok := d.GetOk("domain"); ok {
req = req.Domain(s.(string))
}
Expand All @@ -99,7 +94,7 @@
return diag.Errorf("No matching tenants found")
}
f := res.Results[0]
d.SetId(f.TenantUuid)
d.SetId(f.BrandUuid)

Check warning on line 97 in internal/provider/data_source_brand.go

View check run for this annotation

Codecov / codecov/patch

internal/provider/data_source_brand.go#L97

Added line #L97 was not covered by tests
setWrapper(d, "domain", f.Domain)
setWrapper(d, "default", f.Default)
setWrapper(d, "branding_title", f.BrandingTitle)
Expand All @@ -111,7 +106,6 @@
setWrapper(d, "flow_unenrollment", f.FlowUnenrollment.Get())
setWrapper(d, "flow_user_settings", f.FlowUserSettings.Get())
setWrapper(d, "flow_device_code", f.FlowDeviceCode.Get())
setWrapper(d, "event_retention", f.EventRetention)
setWrapper(d, "web_certificate", f.WebCertificate.Get())
return diags
}
29 changes: 29 additions & 0 deletions internal/provider/data_source_brand_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package provider

import (
"testing"

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

func TestAccDataSourceBrand(t *testing.T) {
resource.UnitTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProviderFactories: providerFactories,
Steps: []resource.TestStep{
{
Config: testAccDataSourceBrandSimple,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.authentik_brand.authentik-default", "domain", "authentik-default"),
resource.TestCheckResourceAttr("data.authentik_brand.authentik-default", "branding_title", "authentik"),
),
},
},
})
}

const testAccDataSourceBrandSimple = `
data "authentik_brand" "authentik-default" {
domain = "authentik-default"
}
`
29 changes: 0 additions & 29 deletions internal/provider/data_source_tenant_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func Provider(version string, testing bool) *schema.Provider {
ResourcesMap: map[string]*schema.Resource{
"authentik_application": tr(resourceApplication),
"authentik_blueprint": tr(resourceBlueprintInstance),
"authentik_brand": tr(resourceBrand),
"authentik_certificate_key_pair": tr(resourceCertificateKeyPair),
"authentik_enterprise_license": tr(resourceEnterpriseLicense),
"authentik_event_rule": tr(resourceEventRule),
Expand Down Expand Up @@ -118,11 +119,11 @@ func Provider(version string, testing bool) *schema.Provider {
"authentik_stage_user_login": tr(resourceStageUserLogin),
"authentik_stage_user_logout": tr(resourceStageUserLogout),
"authentik_stage_user_write": tr(resourceStageUserWrite),
"authentik_tenant": tr(resourceTenant),
"authentik_token": tr(resourceToken),
"authentik_user": tr(resourceUser),
},
DataSourcesMap: map[string]*schema.Resource{
"authentik_brand": td(dataSourceBrand),
"authentik_certificate_key_pair": td(dataSourceCertificateKeyPair),
"authentik_flow": td(dataSourceFlow),
"authentik_group": td(dataSourceGroup),
Expand All @@ -136,7 +137,6 @@ func Provider(version string, testing bool) *schema.Provider {
"authentik_scope_mapping": td(dataSourceScopeMapping),
"authentik_source": td(dataSourceSource),
"authentik_stage": td(dataSourceStage),
"authentik_tenant": td(dataSourceTenant),
"authentik_user": td(dataSourceUser),
"authentik_users": td(dataSourceUsers),
},
Expand Down
Loading
Loading