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)
- regression: coverage change from 0.63.0+ HOT 4
- WithPartialEval losses r.Runtime HOT 2
- OPA panics in nested use of `every` HOT 3
- wasm: entrypoints for rules with "/" in their package parts are broken HOT 1
- OPA high latency - potential cause: bad memory allocations HOT 2
- 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 HOT 2
- Loading JSON array as data reports "bad document type" โ should be more specific
- `--authorization=basic` breaks gzipped request decompression HOT 1
- Cease pushing of opa-envoy rootless images
- OPA inspect command failing after version upgrade on mock-tests for remote/external function dependencies HOT 3
- Unexpected recursion error on dotted rule head containing vars
- custom bucket sizes in opa-envoy-plugin HOT 1
- Errors from builtins in tests are not reported as documented HOT 10
- Update docs to show correct prometheus metrics exports HOT 1
- Add `strings.count(string, substring)` built-in function HOT 6
- Memory leak in topdown due to global compiled regex/glob pattern cache HOT 1
- graphql.parse(query, schema) no longer returns definition as part of the query ast HOT 1
- fmt: running with `--rego-v1` produced unparseable 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.