Comments (5)
@c2zwdjnlcg is this something you can look into? @mbamber if you'd like to submit a fix, feel free to do so. Thanks.
from opa.
If I knew how to fix it, I would have already submitted a PR ๐
I've spent the last few hours trying to workout how all the tests etc work but I must admit I'm somewhat floundering. If you can point me in the direction of how to debug the tests, that would certainly help.
from opa.
I did manage to discover the following though:
Given the following opa test which uses the same data from test/cases/testdata/providers-aws/aws-sign_req.yaml
test_headers if {
req := {"method": "get", "url": "http://example.com", "headers": {"foo": "bar"}}
expected := {
"headers": {
"Authorization": "AWS4-HMAC-SHA256 Credential=MYAWSACCESSKEYGOESHERE/20151228/us-east-1/s3/aws4_request,SignedHeaders=foo;host;x-amz-content-sha256;x-amz-date,Signature=8f1dc7c9b9978356a0d0989fd26a95307f4f8a4aa264d8220647b7097d839952",
"host": "example.com",
"x-amz-content-sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"x-amz-date": "20151228T140825Z",
"foo": "bar"
},
"method": "get",
"url": "http://example.com"
}
aws_config := {
"aws_access_key": "MYAWSACCESSKEYGOESHERE",
"aws_secret_access_key": "MYAWSSECRETACCESSKEYGOESHERE",
"aws_service": "s3",
"aws_region": "us-east-1",
}
r := providers.aws.sign_req(req, aws_config, 1451311705000000000)
print(r)
print(expected)
r == expected
}
... I get the following output:
[redacted].test_headers: FAIL (447.645ยตs)
{"headers": {"Authorization": "AWS4-HMAC-SHA256 Credential=MYAWSACCESSKEYGOESHERE/20151228/us-east-1/s3/aws4_request,SignedHeaders=foo;host;x-amz-content-sha256;x-amz-date,Signature=8f1dc7c9b9978356a0d0989fd26a95307f4f8a4aa264d8220647b7097d839952", "host": "example.com", "x-amz-content-sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "x-amz-date": "20151228T140825Z"}, "method": "get", "url": "http://example.com"}
{"headers": {"Authorization": "AWS4-HMAC-SHA256 Credential=MYAWSACCESSKEYGOESHERE/20151228/us-east-1/s3/aws4_request,SignedHeaders=foo;host;x-amz-content-sha256;x-amz-date,Signature=8f1dc7c9b9978356a0d0989fd26a95307f4f8a4aa264d8220647b7097d839952", "foo": "bar", "host": "example.com", "x-amz-content-sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "x-amz-date": "20151228T140825Z"}, "method": "get", "url": "http://example.com"}
which I think confirms my suspicion that this is a bug (either that or I'm misunderstanding the use of this builtin)
from opa.
I can't reproduce, you sure you have the right version of the binary? what's the full output of opa version
from opa.
You're absolutely right, sorry for wasting your time @c2zwdjnlcg
We were using a out of date version in the tests and once upgraded we can confirm that headers are not dropped
from opa.
Related Issues (20)
- Allow `not every` HOT 5
- Using non-collections with `every` should fail
- Formatter rewrites quoted reference containing keyword to non-quoted one which fails to parse HOT 1
- OPA test - fails to identify the keyword present in policy name and still passes all the tests without failing HOT 6
- OAuth2ClientCredentialsAuthPlugin: fatal error: concurrent map writes HOT 2
- Running `inspect` on a WASM bundle fails if the bundle contains an annotation with the `related_resources` metadata field HOT 3
- zinc.systems has adopted OPA HOT 2
- Update our wasmtime HOT 1
- AST: `text` element in location for annotations just says `#METADATA`
- Strange null results for multi-expression-query in case of `false` HOT 4
- docs: Missing monitoring metric `go_memstats_gc_cpu_fraction`
- regression: coverage change from 0.63.0+ HOT 3
- WithPartialEval losses r.Runtime HOT 1
- OPA panics in nested use of `every` HOT 3
- wasm: entrypoints for rules with "/" in their package parts are broken
- OPA high latency - potential cause: bad memory allocations HOT 1
- Add annotation to AST package node HOT 1
- Not clear why metadata attribute `entrypoint` requires `scope: rule` HOT 1
- Allow `opa inspect` to inspect a single file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opa.