-
Notifications
You must be signed in to change notification settings - Fork 376
Revert back "import" property and replace it with native import block. Fixes (#870) (#1007) and unblocks (#1267)
#1359
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
base: main
Are you sure you want to change the base?
Changes from all commits
f6e7d42
a7db79b
780e128
2304059
a894388
e894a7c
725f986
1bac611
7814294
8072928
63dbd7f
3171521
af9a739
46516d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -161,6 +161,28 @@ func (keycloakClient *KeycloakClient) NewOpenidClient(ctx context.Context, clien | |
| return nil | ||
| } | ||
|
|
||
| func (keycloakClient *KeycloakClient) SearchOpenidClientExact(ctx context.Context, realmId string, clientId string) (*OpenidClient, error) { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is needed to import clients by their respective ClientId |
||
| var clients []*OpenidClient | ||
|
|
||
| err := keycloakClient.get(ctx, fmt.Sprintf("/realms/%s/clients", realmId), &clients, map[string]string{ | ||
| "first": "0", | ||
| "max": "101", | ||
| "clientId": clientId, | ||
| "search": "true", | ||
| }) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| for _, client := range clients { | ||
| client.RealmId = realmId | ||
| if client.ClientId == clientId { | ||
| return client, nil | ||
| } | ||
| } | ||
|
|
||
| return nil, fmt.Errorf("openid clientId %s does not exist in realm %s", clientId, realmId) | ||
| } | ||
|
|
||
| func (keycloakClient *KeycloakClient) GetOpenidClients(ctx context.Context, realmId string, withSecrets bool) ([]*OpenidClient, error) { | ||
| var clients []*OpenidClient | ||
| var clientSecret OpenidClientSecret | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,19 +110,19 @@ func dataSourceKeycloakOpenidClient() *schema.Resource { | |
| }, | ||
| "client_offline_session_idle_timeout": { | ||
| Type: schema.TypeString, | ||
| Computed: true, | ||
| Optional: true, | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is part of a revert commit I was telling in the description |
||
| }, | ||
| "client_offline_session_max_lifespan": { | ||
| Type: schema.TypeString, | ||
| Computed: true, | ||
| Optional: true, | ||
| }, | ||
| "client_session_idle_timeout": { | ||
| Type: schema.TypeString, | ||
| Computed: true, | ||
| Optional: true, | ||
| }, | ||
| "client_session_max_lifespan": { | ||
| Type: schema.TypeString, | ||
| Computed: true, | ||
| Optional: true, | ||
| }, | ||
| "exclude_session_state_from_auth_response": { | ||
| Type: schema.TypeBool, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import ( | |
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/hashicorp/terraform-plugin-sdk/v2/diag" | ||
| "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" | ||
| "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
| "github.com/hashicorp/terraform-plugin-sdk/v2/meta" | ||
|
|
@@ -41,6 +42,15 @@ func init() { | |
| panic(err) | ||
| } | ||
| testAccProvider = KeycloakProvider(keycloakClient) | ||
|
|
||
| testAccProvider.ResourcesMap["keycloak_openid_client"].DeleteContext = func(ctx context.Context, data *schema.ResourceData, i interface{}) diag.Diagnostics { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I need to make this part more clearer. I believe, we must not alter the behavior of standard response of KeyCloak when client is deleted, nor hide that fact that KeyCloak response is 400 in the production code. For now, I left a comment in git the commit for this. |
||
| if data.State().Attributes["client_id"] == "account" { | ||
| return nil | ||
| } else { | ||
| return resourceKeycloakOpenidClientDelete(ctx, data, i) | ||
| } | ||
| } | ||
|
|
||
| testAccProviderFactories = map[string]func() (*schema.Provider, error){ | ||
| "keycloak": func() (*schema.Provider, error) { | ||
| return testAccProvider, nil | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://hub.docker.com/u/bitnamilegacy
bitnami is no longer free