-
Notifications
You must be signed in to change notification settings - Fork 81
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
Sequelize findOrCreate(...).spread is not a function #310
Comments
Fixed
Regards
Santiago
… El 6 ene 2023, a las 10:12, Jason Fox ***@***.***> escribió:
Can’tpass an Updated Policy Set to Authzforce
Related FIWARE/tutorials.Administrating-XACML#9 <FIWARE/tutorials.Administrating-XACML#9>
Updating an existing XACML role should cause Keyrock to sent an updated Policy set to Authzforce:
curl -X POST \
http://localhost:3005/v1/applications/tutorial-dckr-site-0000-xpresswebapp/roles/security-role-0000-0000-000000000000/permissions/alrmbell-ring-24hr-xaml-000000000000 \
-H 'Content-Type: application/json' \
-H 'X-Auth-token: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
The actual result is an Internal Error in Keyrock:
2023-01-06T08:19:59.371Z idm:api-role_permission_assignments --> create
TypeError: models.role_permission.findOrCreate(...).spread is not a function
at exports.create (/opt/fiware-idm/controllers/api/role_permission_assignments.js:80:8)
at ....
Looking at role_permission_assignments.js, it is assuming that the model is returning an Array - but with Sequelize 6 it returns a Promise<Model, boolean> - the function signature has changed between Sequelize 4 and Sequelize 6
models.role_permission
.findOrCreate({
where: { role_id: req.role.id, permission_id: req.permission.id },
defaults: { role_id: req.role.id, permission_id: req.permission.id }
})
.spread(function (assignment, created) { ...
... so I think that with the update to Sequelize 6 the code needs updating <https://stackoverflow.com/questions/63368787/sequelize-findorcreate-spread-is-not-a-function>
The .findOrCreate{}.spread() paradigm is used in multiple places <https://github.com/ging/fiware-idm/search?q=spread> in the code base, can you check which functions have not been updated and fix and test them.
—
Reply to this email directly, view it on GitHub <#310>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAFPBAHX2DX65XRGDWTRF4DWQ7OZRANCNFSM6AAAAAATS34B3M>.
You are receiving this because you are subscribed to this thread.
|
Thanks for that @sanpago - will there be a Docker image made available (e.g. updated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can’tpass an Updated Policy Set to Authzforce
Related FIWARE/tutorials.Administrating-XACML#9
Updating an existing XACML role should cause Keyrock to sent an updated Policy set to Authzforce:
The actual result is an Internal Error in Keyrock:
Looking at role_permission_assignments.js, it is assuming that the model is returning an
Array
- but with Sequelize 6 it returns aPromise<Model, boolean>
- the function signature has changed between Sequelize 4 and Sequelize 6... so I think that with the update to Sequelize 6 the code needs updating
The
.findOrCreate{}.spread()
paradigm is used in multiple places in the code base, can you check which functions have not been updated and fix and test them.The text was updated successfully, but these errors were encountered: