Skip to content

Commit

Permalink
fixup: add to structures
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Toozs committed Dec 8, 2023
1 parent c3e46eb commit 000b8bd
Show file tree
Hide file tree
Showing 2 changed files with 177 additions and 157 deletions.
32 changes: 26 additions & 6 deletions lib/policyEvaluator/RequestContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ function _buildArn(
}
if (specificResource) {
return `arn:aws:iam::${accountId}:` +
`${generalResource}${specificResource}`;
`${generalResource}${specificResource}`;
}
return `arn:aws:iam::${accountId}:${generalResource}`;
}
case 'ring': {
// arn:aws:iam::<account-id>:<resource-type>/<resource>
if (specificResource) {
return `arn:aws:ring::${requesterInfo!.accountid}:` +
`${generalResource}/${specificResource}`;
`${generalResource}/${specificResource}`;
}
return `arn:aws:ring::${requesterInfo!.accountid}:${generalResource}`;
}
Expand All @@ -85,10 +85,10 @@ function _buildArn(
// (possible resource types are buckets, accounts or users)
if (specificResource) {
return `arn:scality:utapi::${requesterInfo!.accountid}:` +
`${generalResource}/${specificResource}`;
`${generalResource}/${specificResource}`;
}
return `arn:scality:utapi::${requesterInfo!.accountid}:` +
`${generalResource}/`;
`${generalResource}/`;
}
case 'sso': {
if (specificResource) {
Expand All @@ -100,10 +100,10 @@ function _buildArn(
// arn:scality:metadata::<account-id>:<resource-type>/<resource>
if (specificResource) {
return `arn:scality:metadata::${requesterInfo!.accountid}:` +
`${generalResource}/${specificResource}`;
`${generalResource}/${specificResource}`;
}
return `arn:scality:metadata::${requesterInfo!.accountid}:` +
`${generalResource}/`;
`${generalResource}/`;
}
default:
return undefined;
Expand Down Expand Up @@ -703,4 +703,24 @@ export default class RequestContext {
getNeedTagEval() {
return this._needTagEval;
}

/**
* Get object lock retention days
*
* @returns objectLockRetentionDays - object lock retention days
*/
getObjectLockRetentionDays() {
return this._objectLockRetentionDays;
}

/**
* Set object lock retention days
*
* @param objectLockRetentionDays - object lock retention days
* @returns itself
*/
setObjectLockRetentionDays(objectLockRetentionDays: number) {
this._objectLockRetentionDays = objectLockRetentionDays;
return this;
}
}
Loading

0 comments on commit 000b8bd

Please sign in to comment.