Compare commits

...

1 Commits

Author SHA1 Message Date
Will Toozs 250e902605
alternative ssl check approach proposal 2024-03-18 14:23:20 +01:00
3 changed files with 10 additions and 6 deletions

View File

@ -247,10 +247,14 @@ function _checkBucketPolicyConditions(request, conditions, log) {
if (!conditions) { if (!conditions) {
return true; return true;
} }
const extractProtocolFromHeader = config.requests.extractProtocolFromHeader;
const sslEnabled = (extractProtocolFromHeader ?
extractProtocolFromHeader === 'https' : request.connection.encrypted);
// build request context from the request! // build request context from the request!
const requestContext = new RequestContext(request.headers, request.query, const requestContext = new RequestContext(request.headers, request.query,
request.bucketName, request.objectKey, ip, 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, null, null, null, null, null, null, null, null, null,
request.objectLockRetentionDays); request.objectLockRetentionDays);
return evaluators.meetConditions(requestContext, conditions, log); return evaluators.meetConditions(requestContext, conditions, log);

View File

@ -20,7 +20,7 @@
"homepage": "https://github.com/scality/S3#readme", "homepage": "https://github.com/scality/S3#readme",
"dependencies": { "dependencies": {
"@hapi/joi": "^17.1.0", "@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", "async": "~2.5.0",
"aws-sdk": "2.905.0", "aws-sdk": "2.905.0",
"azure-storage": "^2.1.0", "azure-storage": "^2.1.0",

View File

@ -488,9 +488,9 @@ arraybuffer.slice@~0.0.7:
optionalDependencies: optionalDependencies:
ioctl "^2.0.2" ioctl "^2.0.2"
"arsenal@git+https://github.com/scality/arsenal#7.10.62": "arsenal@git+https://github.com/scality/arsenal#0466eb4d82624796190338e8892bc3ea2c0908e5":
version "7.10.62" version "7.10.59"
resolved "git+https://github.com/scality/arsenal#e9d815cc9d212932924a5388173548ff804edc6b" resolved "git+https://github.com/scality/arsenal#0466eb4d82624796190338e8892bc3ea2c0908e5"
dependencies: dependencies:
"@types/async" "^3.2.12" "@types/async" "^3.2.12"
"@types/utf8" "^3.0.1" "@types/utf8" "^3.0.1"
@ -523,7 +523,7 @@ arraybuffer.slice@~0.0.7:
sproxydclient "github:scality/sproxydclient#8.0.4" sproxydclient "github:scality/sproxydclient#8.0.4"
utf8 "2.1.2" utf8 "2.1.2"
uuid "^3.0.1" uuid "^3.0.1"
werelogs scality/werelogs#8.1.4 werelogs scality/werelogs#8.1.0
xml2js "~0.4.23" xml2js "~0.4.23"
optionalDependencies: optionalDependencies:
ioctl "^2.0.2" ioctl "^2.0.2"