feat: Remove OIDC and SSO support
Existing SSO accounts have no local password, so the migration deactivates them before dropping is_sso_user and the identity_provider_user table.
This commit is contained in:
@@ -95,10 +95,6 @@
|
||||
* enum: [byDefault, alphabetically, byCreationTime]
|
||||
* description: Default sort order for projects display
|
||||
* example: byDefault
|
||||
* isSsoUser:
|
||||
* type: boolean
|
||||
* description: Whether the user is SSO user (only false value to unlink SSO, for admins)
|
||||
* example: false
|
||||
* isDeactivated:
|
||||
* type: boolean
|
||||
* description: Whether the user account is deactivated and cannot log in (for admins)
|
||||
@@ -127,7 +123,6 @@
|
||||
* $ref: '#/components/responses/Conflict'
|
||||
*/
|
||||
|
||||
const { is } = require('../../../utils/validators');
|
||||
const { idInput } = require('../../../utils/inputs');
|
||||
|
||||
const Errors = {
|
||||
@@ -205,10 +200,6 @@ module.exports = {
|
||||
type: 'string',
|
||||
isIn: Object.values(User.ProjectOrders),
|
||||
},
|
||||
isSsoUser: {
|
||||
type: 'boolean',
|
||||
custom: is(false),
|
||||
},
|
||||
isDeactivated: {
|
||||
type: 'boolean',
|
||||
},
|
||||
@@ -233,7 +224,7 @@ module.exports = {
|
||||
if (inputs.id === currentUser.id) {
|
||||
availableInputKeys.push(...User.PERSONAL_FIELD_NAMES);
|
||||
} else if (currentUser.role === User.Roles.ADMIN) {
|
||||
availableInputKeys.push('role', 'isSsoUser', 'isDeactivated');
|
||||
availableInputKeys.push('role', 'isDeactivated');
|
||||
} else {
|
||||
throw Errors.USER_NOT_FOUND; // Forbidden
|
||||
}
|
||||
@@ -257,14 +248,6 @@ module.exports = {
|
||||
if (inputs.role || inputs.name) {
|
||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||
}
|
||||
} else if (user.isSsoUser) {
|
||||
if (!sails.config.custom.oidcIgnoreRoles && inputs.role) {
|
||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||
}
|
||||
|
||||
if (inputs.name) {
|
||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||
}
|
||||
}
|
||||
|
||||
const values = {
|
||||
@@ -283,7 +266,6 @@ module.exports = {
|
||||
'defaultEditorMode',
|
||||
'defaultHomeView',
|
||||
'defaultProjectsOrder',
|
||||
'isSsoUser',
|
||||
'isDeactivated',
|
||||
]),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user