Add a customisation point for widget permissions to preapprove identity request#9910
Conversation
…ustomization # Conflicts: # src/stores/widgets/StopGapWidgetDriver.ts
|
Signed-off-by: Mikhail Aheichyk mikhail.aheichyk@nordeck.net |
richvdh
left a comment
There was a problem hiding this comment.
As someone totally unfamiliar with the widgets interface: isn't there some documentation that needs updating?
| async function isIdentityRequestPreapproved(widget: Widget): Promise<boolean> { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
as I understand it, this function is never called, and only exists to provide the type of IWidgetPermissionCustomisations.isIdentityRequestPreapproved ? It seems a very round-the-houses way of defining a type.
There was a problem hiding this comment.
You are correct, this function is not called and just an example for how the customization can be implemented. During build time it is replaced with another function if desired, so isIdentityRequestPreapproved would really never be used.
As all other customizations are implement this way, e.g. the preapproveCapabilities function above, so I think we should keep the pattern?
There was a problem hiding this comment.
are there any other examples of this than preapproveCapabilities?
At the very least, please add a comment to the function saying it is never called and is only an example.
There was a problem hiding this comment.
Function is updated with the comment that it is used to provide the type only.
src/customisations contains more similar use cases, for example: 'src/customisations/Security.ts'
| } | ||
|
|
||
| /** | ||
| * Approves the widget for identity token request, if it can be approved. |
There was a problem hiding this comment.
- Approves the widget for identity token request, if it can be approved.
I'm afraid I don't understand what this sentence means. It seems very circular?
There was a problem hiding this comment.
yes, it was simplified.
|
Also: note that this is failing the CI quality gate. It will need some tests, please. |
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
I think it is a bit tricky to test a new code added to |
|
Closing this PR in favor of #10121 |
A new customization point for widget permissions to allow preapproval of identity requests for the widgets.
This will allow forks customization and consistent with #5439
Checklist
Here's what your changelog entry will look like:
✨ Features