Compare commits
4 Commits
developmen
...
feature/AR
Author | SHA1 | Date |
---|---|---|
williamlardier | 99d9abb28f | |
williamlardier | 9e9fa1378e | |
williamlardier | cb14d22822 | |
williamlardier | 9c7024409d |
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue