Compare commits

...

3 Commits

Author SHA1 Message Date
Maha Benzekri bcac2a872f
ARSN-368:Bump arsenal version 2023-10-02 14:24:35 +02:00
Maha Benzekri ca64d7cdcf
ARSN-365:Id added on policy schema and validator
Signed-off-by: Maha Benzekri <maha.benzekri@scality.com>
(cherry picked from commit 9ea39c6ed9)
2023-10-02 14:23:38 +02:00
Maha Benzekri 655071527f
ARSN-367:principal change on schema and test add
The maximum length should be 2048 characters
having 31 characters on the fixed length prefix
this explains the 2017 max limit put in the schema

(cherry picked from commit 73c6f41fa3)
2023-10-02 14:22:49 +02:00
4 changed files with 12 additions and 3 deletions

View File

@ -38,7 +38,7 @@
}, },
"principalAWSUserArn": { "principalAWSUserArn": {
"type": "string", "type": "string",
"pattern": "^arn:aws:iam::[0-9]{12}:user/(?!\\*)[\\w+=,.@ -/]{1,64}$" "pattern": "^arn:aws:iam::[0-9]{12}:user/(?!\\*)[\\w+=,.@ -/]{1,2017}$"
}, },
"principalAWSRoleArn": { "principalAWSRoleArn": {
"type": "string", "type": "string",
@ -360,6 +360,9 @@
"type": "string", "type": "string",
"const": "2012-10-17" "const": "2012-10-17"
}, },
"Id": {
"type": "string"
},
"Statement": { "Statement": {
"oneOf": [ "oneOf": [
{ {

View File

@ -28,7 +28,7 @@
}, },
"principalAWSUserArn": { "principalAWSUserArn": {
"type": "string", "type": "string",
"pattern": "^arn:aws:iam::[0-9]{12}:user/(?!\\*)[\\w+=,.@ -/]{1,64}$" "pattern": "^arn:aws:iam::[0-9]{12}:user/(?!\\*)[\\w+=,.@ -/]{1,2017}$"
}, },
"principalAWSRoleArn": { "principalAWSRoleArn": {
"type": "string", "type": "string",

View File

@ -3,7 +3,7 @@
"engines": { "engines": {
"node": ">=16" "node": ">=16"
}, },
"version": "7.70.4", "version": "7.70.4-1",
"description": "Common utilities for the S3 project components", "description": "Common utilities for the S3 project components",
"main": "build/index.js", "main": "build/index.js",
"repository": { "repository": {

View File

@ -16,6 +16,7 @@ const sampleUserPolicy = {
}; };
const sampleResourcePolicy = { const sampleResourcePolicy = {
Version: '2012-10-17', Version: '2012-10-17',
Id: 'cd3ad3d9-2776-4ef1-a904-4c229d1642ee',
Statement: [ Statement: [
{ {
Sid: 'ResourcePolicy1', Sid: 'ResourcePolicy1',
@ -187,6 +188,11 @@ describe('Policies validation - Principal', () => {
value: { AWS: 'arn:aws:iam::111111111111:user/path/in/org/leaf' }, value: { AWS: 'arn:aws:iam::111111111111:user/path/in/org/leaf' },
policyType: [user, resource], policyType: [user, resource],
}, },
{
name: 'user arn with vault made path',
value: { AWS: 'arn:aws:iam::767707094035:user/user2/TENANT_USER/null/5417be27-8709-48bd-adfb-865ebc58b9f0/1a464be02ea631bdaf2a9ee884434233374a457460e925bf10d9e4665f8fa796/c1d83067-a3f3-41a4-bd45-d6bf47270bd0' }, // eslint-disable-line max-len
policyType: [user, resource],
},
{ {
name: 'multiple user arns', name: 'multiple user arns',
value: { value: {