Skip to content

Commit

Permalink
Bump goauthentik.io/api/v3 from 3.2023106.1 to 3.2023106.3 (#460)
Browse files Browse the repository at this point in the history
Bumps [goauthentik.io/api/v3](https://github.com/goauthentik/client-go)
from 3.2023106.1 to 3.2023106.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/goauthentik/client-go/releases">goauthentik.io/api/v3's
releases</a>.</em></p>
<blockquote>
<h2>v3.2023106.3</h2>
<h4>What's Changed</h4>
<hr />
<h5><code>GET</code> /propertymappings/rac/</h5>
<h6>Parameters:</h6>
<p>Changed: <code>managed</code> in <code>query</code></p>
<h2>v3.2023106.2</h2>
<h4>What's Changed</h4>
<hr />
<h5><code>GET</code> /sources/oauth/source_types/</h5>
<h6>Return Type:</h6>
<p>Changed response : <strong>200 OK</strong></p>
<ul>
<li>
<p>Changed content type : <code>application/json</code></p>
<p>Changed items (object):
&gt; Serializer for SourceType</p>
<p>New required properties:</p>
<ul>
<li><code>verbose_name</code></li>
</ul>
<p>New optional properties:</p>
<ul>
<li><code>slug</code></li>
</ul>
<ul>
<li>
<p>Added property <code>verbose_name</code> (string)</p>
</li>
<li>
<p>Deleted property <code>slug</code> (string)</p>
</li>
</ul>
</li>
</ul>
<h5><code>GET</code> /sources/oauth/{slug}/</h5>
<h6>Return Type:</h6>
<p>Changed response : <strong>200 OK</strong></p>
<ul>
<li>
<p>Changed content type : <code>application/json</code></p>
<ul>
<li>Changed property <code>type</code> (object)
<blockquote>
<p>Serializer for SourceType</p>
</blockquote>
</li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/goauthentik/client-go/commit/2b3912d0a54bdd5289ec0746240eeb74393c6003"><code>2b3912d</code></a>
Update API Client</li>
<li><a
href="https://github.com/goauthentik/client-go/commit/2ea3dae112f70e4a9f8f8f64b3712792c5cac9e2"><code>2ea3dae</code></a>
Update API Client</li>
<li>See full diff in <a
href="https://github.com/goauthentik/client-go/compare/v3.2023106.1...v3.2023106.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=goauthentik.io/api/v3&package-manager=go_modules&previous-version=3.2023106.1&new-version=3.2023106.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
  • Loading branch information
BeryJu authored Jan 15, 2024
2 parents 65a57ea + b6dd95d commit b4a12d5
Show file tree
Hide file tree
Showing 13 changed files with 137 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/data-sources/property_mapping_ldap.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ data "authentik_property_mapping_ldap" "test" {

- `ids` (List of String) List of ids when `managed_list` is set. Generated.
- `managed` (String)
- `managed_list` (List of String) Retrive multiple property mappings
- `managed_list` (List of String) Retrieve multiple property mappings
- `name` (String)
- `object_field` (String) Generated.

Expand Down
28 changes: 28 additions & 0 deletions docs/data-sources/property_mapping_rac.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
page_title: "authentik_property_mapping_rac Data Source - terraform-provider-authentik"
subcategory: "Customization"
description: |-
Get RAC Property mappings
---

# authentik_property_mapping_rac (Data Source)

Get RAC Property mappings



<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `ids` (List of String) List of ids when `managed_list` is set. Generated.
- `managed` (String)
- `managed_list` (List of String) Retrieve multiple property mappings
- `name` (String)
- `settings` (String) Generated.

### Read-Only

- `expression` (String) Generated.
- `id` (String) The ID of this resource.
2 changes: 1 addition & 1 deletion docs/data-sources/property_mapping_saml.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ data "authentik_property_mapping_saml" "test" {
- `friendly_name` (String) Generated.
- `ids` (List of String) List of ids when `managed_list` is set. Generated.
- `managed` (String)
- `managed_list` (List of String) Retrive multiple property mappings
- `managed_list` (List of String) Retrieve multiple property mappings
- `name` (String)
- `saml_name` (String) Generated.

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/property_mapping_scim.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ data "authentik_property_mapping_scim" "test" {

- `ids` (List of String) List of ids when `managed_list` is set. Generated.
- `managed` (String)
- `managed_list` (List of String) Retrive multiple property mappings
- `managed_list` (List of String) Retrieve multiple property mappings
- `name` (String)

### Read-Only
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/scope_mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ data "authentik_scope_mapping" "test" {

- `ids` (List of String) List of ids when `managed_list` is set. Generated.
- `managed` (String)
- `managed_list` (List of String) Retrive multiple property mappings
- `managed_list` (List of String) Retrieve multiple property mappings
- `name` (String)
- `scope_name` (String) Generated.

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.1
goauthentik.io/api/v3 v3.2023106.3
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,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.1 h1:HHXiw11tZzhHq5kLf43/ZhsOj+BqaHzwqWYiEOF/UpE=
goauthentik.io/api/v3 v3.2023106.1/go.mod h1:zz+mEZg8rY/7eEjkMGWJ2DnGqk+zqxuybGCGrR2O4Kw=
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=
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
2 changes: 1 addition & 1 deletion internal/provider/data_source_property_mapping_ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func dataSourceLDAPPropertyMapping() *schema.Resource {
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "Retrive multiple property mappings",
Description: "Retrieve multiple property mappings",
},

"ids": {
Expand Down
97 changes: 97 additions & 0 deletions internal/provider/data_source_property_mapping_rac.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
package provider

import (
"context"

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

func dataSourceRACPropertyMapping() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceRACPropertyMappingRead,
Description: "Customization --- Get RAC Property mappings",
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Optional: true,
ConflictsWith: []string{"managed_list"},
},
"managed": {
Type: schema.TypeString,
Optional: true,
},

"managed_list": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "Retrieve multiple property mappings",
},

"ids": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "List of ids when `managed_list` is set.",
},

"settings": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"expression": {
Type: schema.TypeString,
Computed: true,
},
},
}
}

func dataSourceRACPropertyMappingRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
var diags diag.Diagnostics
c := m.(*APIClient)

req := c.client.PropertymappingsApi.PropertymappingsRacList(ctx)

if ml, ok := d.GetOk("managed_list"); ok {
req = req.Managed(castSlice[string](ml.([]interface{})))
} else if m, ok := d.GetOk("managed"); ok {
req = req.Managed([]string{m.(string)})
}

if n, ok := d.GetOk("name"); ok {
req = req.Name(n.(string))
}

res, hr, err := req.Execute()
if err != nil {
return httpToDiag(d, hr, err)
}

if len(res.Results) < 1 {
return diag.Errorf("No matching mappings found")
}
if _, ok := d.GetOk("managed_list"); ok {
d.SetId("-1")
ids := make([]string, len(res.Results))
for i, r := range res.Results {
ids[i] = r.Pk
}
setWrapper(d, "ids", ids)
} else {
f := res.Results[0]
d.SetId(f.Pk)
setWrapper(d, "name", f.Name)
setWrapper(d, "name", f.Name)
setWrapper(d, "expression", f.Expression)
setWrapper(d, "settings", f.StaticSettings)
}
return diags
}
2 changes: 1 addition & 1 deletion internal/provider/data_source_property_mapping_saml.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func dataSourceSAMLPropertyMapping() *schema.Resource {
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "Retrive multiple property mappings",
Description: "Retrieve multiple property mappings",
},

"ids": {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/data_source_property_mapping_scim.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func dataSourceSCIMropertyMapping() *schema.Resource {
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "Retrive multiple property mappings",
Description: "Retrieve multiple property mappings",
},

"ids": {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/data_source_scope_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func dataSourceScopeMapping() *schema.Resource {
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "Retrive multiple property mappings",
Description: "Retrieve multiple property mappings",
},

"ids": {
Expand Down
1 change: 1 addition & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func Provider(version string, testing bool) *schema.Provider {
"authentik_group": td(dataSourceGroup),
"authentik_groups": td(dataSourceGroups),
"authentik_property_mapping_ldap": td(dataSourceLDAPPropertyMapping),
"authentik_property_mapping_rac": td(dataSourceRACPropertyMapping),
"authentik_property_mapping_saml": td(dataSourceSAMLPropertyMapping),
"authentik_property_mapping_scim": td(dataSourceSCIMropertyMapping),
"authentik_provider_oauth2_config": td(dataSourceProviderOAuth2Config),
Expand Down

0 comments on commit b4a12d5

Please sign in to comment.