diff --git a/lib/api/apiUtils/authorization/permissionChecks.js b/lib/api/apiUtils/authorization/permissionChecks.js index 170488b44b..ee1bf5d036 100644 --- a/lib/api/apiUtils/authorization/permissionChecks.js +++ b/lib/api/apiUtils/authorization/permissionChecks.js @@ -247,10 +247,14 @@ function _checkBucketPolicyConditions(request, conditions, log) { if (!conditions) { return true; } + const extractProtocolFromHeader = config.requests.extractProtocolFromHeader; + + const sslEnabled = (extractProtocolFromHeader ? + extractProtocolFromHeader === 'https' : request.connection.encrypted); // build request context from the request! const requestContext = new RequestContext(request.headers, request.query, request.bucketName, request.objectKey, ip, - request.connection.encrypted, request.resourceType, 's3', null, null, + sslEnabled, request.resourceType, 's3', null, null, null, null, null, null, null, null, null, null, null, request.objectLockRetentionDays); return evaluators.meetConditions(requestContext, conditions, log); diff --git a/package.json b/package.json index de3518e28e..73a35391d1 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "homepage": "https://github.com/scality/S3#readme", "dependencies": { "@hapi/joi": "^17.1.0", - "arsenal": "git+https://github.com/scality/arsenal#7.10.62", + "arsenal": "git+https://github.com/scality/arsenal#0466eb4d82624796190338e8892bc3ea2c0908e5", "async": "~2.5.0", "aws-sdk": "2.905.0", "azure-storage": "^2.1.0", diff --git a/yarn.lock b/yarn.lock index c421d793d1..de97c5550d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -488,9 +488,9 @@ arraybuffer.slice@~0.0.7: optionalDependencies: ioctl "^2.0.2" -"arsenal@git+https://github.com/scality/arsenal#7.10.62": - version "7.10.62" - resolved "git+https://github.com/scality/arsenal#e9d815cc9d212932924a5388173548ff804edc6b" +"arsenal@git+https://github.com/scality/arsenal#0466eb4d82624796190338e8892bc3ea2c0908e5": + version "7.10.59" + resolved "git+https://github.com/scality/arsenal#0466eb4d82624796190338e8892bc3ea2c0908e5" dependencies: "@types/async" "^3.2.12" "@types/utf8" "^3.0.1" @@ -523,7 +523,7 @@ arraybuffer.slice@~0.0.7: sproxydclient "github:scality/sproxydclient#8.0.4" utf8 "2.1.2" uuid "^3.0.1" - werelogs scality/werelogs#8.1.4 + werelogs scality/werelogs#8.1.0 xml2js "~0.4.23" optionalDependencies: ioctl "^2.0.2"