move tokens.ID_ into oidcClients.ID_

This commit is contained in:
Girish Ramakrishnan
2025-06-11 22:53:29 +02:00
parent 00da650524
commit d112d6308c
11 changed files with 48 additions and 42 deletions
-17
View File
@@ -13,18 +13,10 @@ exports = module.exports = {
listByUserId,
getByAccessToken,
validateTokenType,
hasScope,
isIpAllowedSync,
// token client ids. we categorize them so we can have different restrictions based on the client
ID_WEBADMIN: 'cid-webadmin', // dashboard
ID_DEVELOPMENT: 'cid-development', // dashboard development
ID_CLI: 'cid-cli', // cloudron cli
ID_SDK: 'cid-sdk', // created by user via dashboard
SCOPES: ['*']//, 'apps', 'domains'],
};
@@ -57,15 +49,6 @@ function validateTokenName(name) {
return null;
}
function validateTokenType(type) {
assert.strictEqual(typeof type, 'string');
const types = [ exports.ID_WEBADMIN, exports.ID_SDK, exports.ID_DEVELOPMENT, exports.ID_CLI ];
if (types.indexOf(type) === -1) return new BoxError(BoxError.BAD_FIELD, `type must be one of ${types.join(',')}`);
return null;
}
function validateScope(scope) {
assert.strictEqual(typeof scope, 'object');