Compare commits

...

4 Commits

Author SHA1 Message Date
williamlardier 99d9abb28f
wip 2022-08-25 16:21:21 +02:00
williamlardier 9e9fa1378e
wip 2022-08-25 15:28:20 +02:00
williamlardier cb14d22822
wip 2022-08-25 13:42:32 +02:00
williamlardier 9c7024409d
wip 2022-08-18 14:41:26 +02:00
3 changed files with 17 additions and 2 deletions

View File

@ -44,8 +44,8 @@ export function validateCredentials(
return errors.RequestTimeTooSkewed; return errors.RequestTimeTooSkewed;
} }
if (service !== 's3' && service !== 'iam' && service !== 'ring' && if (service !== 's3' && service !== 'iam' && service !== 'ring' &&
service !== 'sts') { service !== 'sts' && service !== 'scality') {
log.warn('service in credentials is not one of s3/iam/ring/sts', { log.warn('service in credentials is not one of s3/iam/ring/sts/scality', {
service, service,
}); });
return errors.InvalidArgument; return errors.InvalidArgument;

View File

@ -11,6 +11,7 @@ import {
actionMapIAM, actionMapIAM,
actionMapSSO, actionMapSSO,
actionMapSTS, actionMapSTS,
actionMapScality,
actionMapMetadata, actionMapMetadata,
} from './utils/actionMaps'; } from './utils/actionMaps';
@ -36,6 +37,8 @@ function _findAction(service: string, method: string) {
return actionMapSTS[method]; return actionMapSTS[method];
case 'metadata': case 'metadata':
return actionMapMetadata[method]; return actionMapMetadata[method];
case 'scality':
return actionMapScality[method];
default: default:
return undefined; return undefined;
} }
@ -49,6 +52,9 @@ function _buildArn(
) { ) {
// arn:partition:service:region:account-id:resourcetype/resource // arn:partition:service:region:account-id:resourcetype/resource
switch (service) { switch (service) {
case 'scality': {
return `arn:aws:iam::${requesterInfo!.accountid}:/${generalResource}/`;
}
case 's3': { case 's3': {
// arn:aws:s3:::bucket/object // arn:aws:s3:::bucket/object
// General resource is bucketName // General resource is bucketName

View File

@ -199,6 +199,14 @@ const actionMapIAM = {
listUserTags: 'iam:ListUserTags', listUserTags: 'iam:ListUserTags',
}; };
const actionMapScality = {
updateAccountAttributes: 'scality:UpdateAccountAttributes',
UpdateAccountQuota: 'scality:UpdateAccountQuota',
DeleteAccountQuota: 'scality:DeleteAccountQuota',
DeleteAccount: 'scality:DeleteAccount',
GenerateAccountAccessKey: 'scality:GenerateAccountAccessKey',
};
const actionMapSSO = { const actionMapSSO = {
SsoAuthorize: 'sso:Authorize', SsoAuthorize: 'sso:Authorize',
}; };
@ -221,4 +229,5 @@ export {
actionMapSSO, actionMapSSO,
actionMapSTS, actionMapSTS,
actionMapMetadata, actionMapMetadata,
actionMapScality,
}; };