Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Conversation

@srenatus
Copy link
Contributor

Let's make sure this is somewhat aligned among the different SDKs... 👀

@srenatus srenatus marked this pull request as draft April 11, 2024 11:00
@srenatus srenatus force-pushed the sr/high-level-low-level branch from 73ee59e to 8c46e96 Compare April 11, 2024 11:38
import rego.v1
default allow := false
allow if input.method == "PUT"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Policy PUT calls happening later in the test setup.

default allow := false
allow if input.method == "PUT"
allow if input.path[0] == "health"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Health check, needed for wait strategy

Comment on lines +40 to +41
allow if input.path[2] == "test"
allow if input.path[2] == "has"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing tests' prefixes

Comment on lines +42 to +45
allow if {
input.path[2] = "token"
input.identity = "opensesame"
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New test: requests for /v1/data/token/* only work with a proper authorization header (bearer token)

content: authzPolicy,
target: "/authz.rego",
},
])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The system authz policy needs to be loaded when the server is started

@srenatus srenatus changed the title highlevel: allow optional low-level SDKOptions highlevel: allow optional headers and low-level SDKOptions Apr 11, 2024
@srenatus srenatus marked this pull request as ready for review April 11, 2024 11:41
@srenatus
Copy link
Contributor Author

I'll fix those conflicts tomorrow 🤞

@srenatus srenatus force-pushed the sr/high-level-low-level branch from 8c46e96 to 420d88c Compare April 12, 2024 07:51
@srenatus srenatus changed the title highlevel: allow optional headers and low-level SDKOptions porcelain: allow optional headers and low-level SDKOptions Apr 12, 2024
});

it("allows custom headers", async () => {
const authorization = "Bearer opensesame";

Check failure

Code scanning / CodeQL

Hard-coded credentials

The hard-coded value "Bearer opensesame" is used as [authorization header](1).
Including a test for each of them.

Signed-off-by: Stephan Renatus <stephan@styra.com>
@srenatus srenatus force-pushed the sr/high-level-low-level branch from 420d88c to 954bfae Compare April 12, 2024 07:56
@srenatus srenatus merged commit 3e8088f into main Apr 12, 2024
@srenatus srenatus deleted the sr/high-level-low-level branch April 12, 2024 08:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants