-
Notifications
You must be signed in to change notification settings - Fork 618
Feature - In-Flow Extension #7946
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: master
Are you sure you want to change the base?
Changes from all commits
256f3c7
3abe160
8ac739b
31c0f2e
2011976
c6526ba
8dcf6eb
ffca806
72425ce
bc2a3cb
7ac1f50
14c6366
f1efaac
1f9e78a
74d6b83
a51ef48
a52f600
c4debd2
98be83c
944de18
6f3d94b
0eaf61c
2aac9a7
261eff1
a63b57e
f054597
447a663
6d9d925
54bfdf4
7239b92
8238705
1d6517c
b1b784c
6785619
93d2047
ee812b9
2398344
ad41b3c
fd9a311
d8c3e9e
1da00f9
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 | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -197,8 +197,13 @@ private Action getActionByActionId(ActionType actionType, String actionId, Strin | |||||||||||||||||||||||||
| throws ActionExecutionException { | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||
| return ActionExecutionServiceComponentHolder.getInstance().getActionManagementService().getActionByActionId( | ||||||||||||||||||||||||||
| Action.ActionTypes.valueOf(actionType.name()).getPathParam(), actionId, tenantDomain); | ||||||||||||||||||||||||||
| Action action = ActionExecutionServiceComponentHolder.getInstance().getActionManagementService() | ||||||||||||||||||||||||||
| .getActionByActionId(Action.ActionTypes.valueOf(actionType.name()).getPathParam(), actionId, | ||||||||||||||||||||||||||
| tenantDomain); | ||||||||||||||||||||||||||
| if (action == null) { | ||||||||||||||||||||||||||
| throw new ActionExecutionRuntimeException("No action found for action Id: " + actionId); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
Comment on lines
+200
to
+205
Contributor
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. Do not convert “action not found” into a silently skipped success path. Throwing Suggested fix- if (action == null) {
- throw new ActionExecutionRuntimeException("No action found for action Id: " + actionId);
- }
+ if (action == null) {
+ throw new ActionExecutionException("No action found for action Id: " + actionId);
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| return action; | ||||||||||||||||||||||||||
| } catch (ActionMgtException e) { | ||||||||||||||||||||||||||
| throw new ActionExecutionException("Error occurred while retrieving action by action Id.", e); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,7 +75,13 @@ public enum ActionTypes { | |
| "PRE_ISSUE_ID_TOKEN", | ||
| "Pre Issue ID Token", | ||
| "Configure an extension point for modifying ID token via a custom service.", | ||
| Category.PRE_POST); | ||
| Category.PRE_POST), | ||
| FLOW_EXTENSIONS( | ||
| "inFlowExtension", | ||
| "FLOW_EXTENSIONS", | ||
| "In-Flow Extension", | ||
| "Configure an extension point within any flow via a custom service.", | ||
| Category.IN_FLOW_EXTENSION); | ||
|
|
||
| private final String pathParam; | ||
| private final String actionType; | ||
|
|
@@ -131,7 +137,8 @@ public static ActionTypes[] filterByCategory(Category category) { | |
| */ | ||
| public enum Category { | ||
| PRE_POST, | ||
| IN_FLOW | ||
| IN_FLOW, | ||
| IN_FLOW_EXTENSION | ||
|
Contributor
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. rename to flow extensions |
||
| } | ||
| } | ||
|
|
||
|
|
||
|
Contributor
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. remove the name check. use a fe validation + backend error |
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.
Defensively copy credential arrays instead of sharing references.
userCredentialsis wrapped as unmodifiable, but eachchar[]value is still mutable and currently shared by reference. That allows external mutation after build/get, which is risky for credential data integrity and secrecy.Proposed fix
@@ public User(Builder builder) { @@ - this.userCredentials.putAll(builder.userCredentials); + builder.userCredentials.forEach((k, v) -> + this.userCredentials.put(k, v != null ? v.clone() : null)); @@ public Map<String, char[]> getUserCredentials() { - - return Collections.unmodifiableMap(userCredentials); + Map<String, char[]> safeCopy = new HashMap<>(); + userCredentials.forEach((k, v) -> safeCopy.put(k, v != null ? v.clone() : null)); + return Collections.unmodifiableMap(safeCopy); } @@ public Builder userCredentials(Map<String, char[]> userCredentials) { - - this.userCredentials.putAll(userCredentials); + if (userCredentials == null) { + return this; + } + userCredentials.forEach((k, v) -> this.userCredentials.put(k, v != null ? v.clone() : null)); return this; }Also applies to: 101-104, 224-227
🤖 Prompt for AI Agents