forked from pulumi/pulumi-auth0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pulumi#237 - fix: Inject user connection name attribute to allow reso…
…urce import
- Loading branch information
Showing
3 changed files
with
27 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
From faa437a52d74af80d5c0960a92866a8d95d62da2 Mon Sep 17 00:00:00 2001 | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Mikhail Shilkov <[email protected]> | ||
Date: Tue, 19 Sep 2023 17:21:23 +0200 | ||
Subject: [PATCH 1/2] Add a shim | ||
Subject: [PATCH 1/3] Add a shim | ||
|
||
--- | ||
shim/shim.go | 10 ++++++++++ | ||
1 file changed, 10 insertions(+) | ||
create mode 100644 shim/shim.go | ||
|
||
diff --git a/shim/shim.go b/shim/shim.go | ||
new file mode 100644 | ||
|
@@ -24,6 +20,3 @@ index 00000000..3c127eb3 | |
+func NewProvider() *schema.Provider { | ||
+ return provider.New() | ||
+} | ||
-- | ||
2.39.3 (Apple Git-145) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
From 674eeedaf4dd11c5936c347d2edc766f7256c58f Mon Sep 17 00:00:00 2001 | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Thomas Kappler <[email protected]> | ||
Date: Fri, 29 Sep 2023 07:52:53 +0200 | ||
Subject: [PATCH 2/2] Patch to avoid upstream ResourceServer panic: code moved | ||
Subject: [PATCH 2/3] Patch to avoid upstream ResourceServer panic: code moved | ||
|
||
--- | ||
internal/auth0/resourceserver/expand.go | 3 ++- | ||
1 file changed, 2 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/internal/auth0/resourceserver/expand.go b/internal/auth0/resourceserver/expand.go | ||
index ee1e6e97..5b1c23fa 100644 | ||
|
@@ -19,6 +16,3 @@ index ee1e6e97..5b1c23fa 100644 | |
+ name := state.GetAttr("name") | ||
+ return !name.IsNull() && name.AsString() == auth0ManagementAPIName | ||
} | ||
-- | ||
2.39.3 (Apple Git-145) | ||
|
23 changes: 23 additions & 0 deletions
23
patches/0003-Patch-to-allow-allow-User-resource-import-inject-con.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Fabrice Baumann <[email protected]> | ||
Date: Thu, 7 Mar 2024 15:11:42 -0500 | ||
Subject: [PATCH 3/3] Patch to allow allow User resource import: inject | ||
connection name attribute | ||
|
||
|
||
diff --git a/internal/auth0/user/resource.go b/internal/auth0/user/resource.go | ||
index bd9258ed..faddb005 100644 | ||
--- a/internal/auth0/user/resource.go | ||
+++ b/internal/auth0/user/resource.go | ||
@@ -175,6 +175,11 @@ func readUser(ctx context.Context, data *schema.ResourceData, meta interface{}) | ||
return diag.FromErr(internalError.HandleAPIError(data, err)) | ||
} | ||
|
||
+ if len(user.Identities) == 1 { | ||
+ userIdentity := user.Identities[0] | ||
+ user.Connection = userIdentity.Connection | ||
+ } | ||
+ | ||
return diag.FromErr(flattenUser(data, user)) | ||
} | ||
|