Comments (2)
There is a challenge with this request:
Scripts are referenced in nodes by UUID, not by name. So if a collision is detected (collision = a script with the same name or the same uuid but not both) then what would be a predictable and reasonable action to take?
Let's assume the following node in a journey:
"25001c7a-7928-4949-9706-0689416b18b0": {
"_id": "25001c7a-7928-4949-9706-0689416b18b0",
"_rev": "-1049667358",
"script": "50cde102-d4b6-44c4-9ba7-8564af05ae08",
"outcomes": [
"true"
],
"outputs": [
"*"
],
"inputs": [
"*"
],
"_type": {
"_id": "ScriptedDecisionNode",
"name": "Scripted Decision",
"collection": true
},
"_outcomes": [
{
"id": "true",
"displayName": "true"
}
]
}
The above node references the following script:
"50cde102-d4b6-44c4-9ba7-8564af05ae08": {
"_id": "50cde102-d4b6-44c4-9ba7-8564af05ae08",
"name": "Select Theme from URL",
"description": "Select and apply theme from query param in the request URL.",
"script": "\"/* Select Theme from URL\\n * \\n * Select and apply theme from query param in the request URL.\\n * \\n * This script does not need to be parametrized. It will work properly as is.\\n * \\n * The Scripted Decision Node needs the following outcomes defined:\\n * - true\\n *\\n * Author: [email protected]\\n */\\n(function () {\\n \\toutcome = \\\"true\\\";\\n \\tvar theme = \\\"\\\";\\n \\tif (requestParameters.get(\\\"themeId\\\")) {\\n \\ttheme = requestParameters.get(\\\"themeId\\\").get(0);\\n }\\n\\n var fr = JavaImporter(\\n org.forgerock.openam.auth.node.api.Action,\\n org.forgerock.openam.authentication.callbacks.PollingWaitCallback\\n )\\n if (theme && callbacks.isEmpty()) {\\n \\tvar stage = \\\"themeId=\\\"+theme;\\n action = fr.Action.send(\\n \\tnew fr.PollingWaitCallback(\\\"100\\\", \\\"Please wait ...\\\")\\n ).withStage(stage).build();\\n } else {\\n \\taction = fr.Action.goTo(outcome).build();\\n }\\n}());\"",
"default": false,
"language": "JAVASCRIPT",
"context": "AUTHENTICATION_TREE_DECISION_NODE",
"createdBy": "null",
"creationDate": 0,
"lastModifiedBy": "null",
"lastModifiedDate": 0
}
And now let's assume a switch --override-dependencies
or --override-scripts
on the journey import
command:
What would the predictable action be for frodo to take in the following situations:
- a script with the same name but different UUID exists
- override the existing script with the code of the incoming script (different UUID ) and re-wire the node to reference the existing UUID (what might this do to other nodes referencing the previous version of the script? What if the name was ambiguously generic and the imported script is significantly different from the existing script despite the same name?)
- delete the existing script (if possible, what if it is referenced by other nodes and cannot be deleted) and create the incoming script with the same name but different UUID.
- rename the existing script to resolve the collision and import the new script with the same name but different UUID (there is no harm to doing this, as names are meaningless in scripts as long as they are unique)
- rename the new script and create it with its UUID and a generated new name (that is what frodo is currently doing. there is no harm in doing this, as names are meaningless in scripts as long as they are unique)
- are there reasonable alternatives?
- a script with the same UUID but different name exists
- override the existing script with the code of the incoming script (different name) and re-name the script (this is what frodo does today, I believe, and there is no harm in this action because it is unlikely that the same UUID would ever be used by a different script but it is still possible if somebody re-purposed an existing script object)
- override the existing script but preserve its name (this seems like an uninteresting option with little benefit)
- are there reasonable alternatives?
from frodo-lib.
Won't do. If at some point we want to add a user-interactive mode to warn/confirm overrides, we would probably do it for all import operations in the same way. Closing.
from frodo-lib.
Related Issues (20)
- Update developer quick start and samples in README.md
- Create typescript example to complement esm and cjs examples
- Validate all info in README.md HOT 1
- Validate all info in CONTRIBUTE.md
- Validate all info in PIPELINE.md HOT 1
- Update CHANGELOG.md with all important changes since 1.x HOT 1
- Update tsdoc HOT 2
- Only "generic" encoding works for ESV secret HOT 1
- Release 2.0.0
- Update NodeOps.ts with latest AM releases and node classifications
- AuthenticateOps.ts doesn't throw
- Update to later or latest Axios version
- Import ESVs (variables and secrets)
- Support new IDM schema API for custom relationships and potentially other schema mods HOT 1
- Support email provider operations HOT 1
- Consistent use of FrodoError throught the library
- Ability to create/select scopes for Service Accounts HOT 1
- Implement error handling pattern for methods with unusual amounts of REST calls like `exportFullConfiguration` (Renamed from: Move ConfigOps to CLI) HOT 4
- frodo error when importing exported oauth client HOT 6
- Add support for `base64aes` encoding for ESV secrets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frodo-lib.