-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fixes in gateway #1157
Bug fixes in gateway #1157
Conversation
.unwrap(); | ||
|
||
assert_eq!(result, TypeAnnotatedValue::Str("foo, bar".to_string())); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added these tests, but there are no bugs in logic
impl GatewayBindingResolverError { | ||
pub fn internal(err: &str) -> Self { | ||
GatewayBindingResolverError::Internal(err.to_string()) | ||
impl ErrorOrRedirect { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During the binding resolution phase itself (resolving a binding based on a http request, where the worker name is also resolved (Ex: worker-${request.auth.given_name})), middlewares such as authentication is applied, and can decide to redirect or not. That's the main change.
let e = public_key.e().to_bytes_be(); | ||
let kid = JsonWebKeyId::new("my-key-id".to_string()); | ||
JsonWebKeySet::new(vec![CoreJsonWebKey::new_rsa(n, e, Some(kid))]) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the test case is better, that the provider metadata will have the public key in it.
And the corresponding id_token will have its private key. Much easier to understand tests
Make sure worker name can look up athentication details, and not just response body.
JWKset were never serialized (its "skipped" in openidconnect library), and provider-metadata reuse for performance reasons resulted in signature mismatch errors. So now for claim verification, we discover the keyset on the fly, and is now consistently working.
2 test additions in Rib, which I thought was missing (but there is no bug here)
Here is a simple end user test with this api-definition, where both worker name and response mapping looks up authentication fields.