-
Notifications
You must be signed in to change notification settings - Fork 24
feat: ability to add public routes that bypass authn middleware #601
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
Merged
strantalis
merged 7 commits into
opentdf:main
from
strantalis:expose-auth-configuration
Apr 22, 2024
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
39faadc
feat: ability to add public routes that bypass authn middleware
strantalis ff43f8c
add new options file
strantalis cc31e82
resolve new lint errors
strantalis 952835f
update to use filepath Match
strantalis 3717a88
fix lint issue
strantalis b8730d3
fix start_test public route path test
strantalis fb86bbc
Merge branch 'main' into expose-auth-configuration
strantalis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "request": { | ||
| "method": "GET", | ||
| "urlPath": "/auth/keys" | ||
| }, | ||
| "response": { | ||
| "status": 200, | ||
| "bodyFileName": "messages/oidc_jwks.json", | ||
| "transformers": [ | ||
| "response-template" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "issuer": "{{request.baseUrl}}/mock-server", | ||
| "authorization_endpoint": "{{request.baseUrl}}/auth/authorize", | ||
| "token_endpoint": "{{request.baseUrl}}/auth/token", | ||
| "userinfo_endpoint": "{{request.baseUrl}}/auth/userinfo", | ||
| "registration_endpoint": "{{request.baseUrl}}/auth/clients", | ||
| "jwks_uri": "{{request.baseUrl}}/auth/keys", | ||
| "response_types_supported": ["code", "id_token", "code id_token", "code token", "id_token token", "code id_token token"], | ||
| "response_modes_supported": ["query", "fragment", "form_post", "okta_post_message"], | ||
| "grant_types_supported": ["authorization_code", "implicit", "refresh_token", "password"], | ||
| "subject_types_supported": ["public"], | ||
| "id_token_signing_alg_values_supported": ["RS256"], | ||
| "scopes_supported": ["sms", "openid", "profile", "email", "address", "phone", "offline_access"], | ||
| "token_endpoint_auth_methods_supported": ["client_secret_basic", "client_secret_post", "client_secret_jwt", "private_key_jwt", "none"], | ||
| "claims_supported": ["iss", "ver", "sub", "aud", "iat", "exp", "jti", "auth_time", "amr", "idp", "nonce", "name", "nickname", "preferred_username", "given_name", "middle_name", "family_name", "email", "email_verified", "profile", "zoneinfo", "locale", "address", "phone_number", "picture", "website", "gender", "birthdate", "updated_at", "at_hash", "c_hash"], | ||
| "code_challenge_methods_supported": ["S256"], | ||
| "introspection_endpoint": "{{request.baseUrl}}/auth/introspect", | ||
| "introspection_endpoint_auth_methods_supported": ["client_secret_basic", "client_secret_post", "client_secret_jwt", "private_key_jwt", "none"], | ||
| "revocation_endpoint": "{{request.baseUrl}}/auth/revoke", | ||
| "revocation_endpoint_auth_methods_supported": ["client_secret_basic", "client_secret_post", "client_secret_jwt", "private_key_jwt", "none"], | ||
| "end_session_endpoint": "{{request.baseUrl}}/auth/logout", | ||
| "request_parameter_supported": true, | ||
| "request_object_signing_alg_values_supported": ["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,30 @@ | ||
| { | ||
| "issuer": "{{request.baseUrl}}/mock-server", | ||
| "authorization_endpoint": "{{request.baseUrl}}/auth/authorize", | ||
| "token_endpoint": "{{request.baseUrl}}/auth/token", | ||
| "userinfo_endpoint": "{{request.baseUrl}}/auth/userinfo", | ||
| "registration_endpoint": "{{request.baseUrl}}/auth/clients", | ||
| "jwks_uri": "{{request.baseUrl}}/auth/keys", | ||
| "response_types_supported": ["code", "id_token", "code id_token", "code token", "id_token token", "code id_token token"], | ||
| "response_modes_supported": ["query", "fragment", "form_post", "okta_post_message"], | ||
| "grant_types_supported": ["authorization_code", "implicit", "refresh_token", "password"], | ||
| "subject_types_supported": ["public"], | ||
| "id_token_signing_alg_values_supported": ["RS256"], | ||
| "scopes_supported": ["sms", "openid", "profile", "email", "address", "phone", "offline_access"], | ||
| "token_endpoint_auth_methods_supported": ["client_secret_basic", "client_secret_post", "client_secret_jwt", "private_key_jwt", "none"], | ||
| "claims_supported": ["iss", "ver", "sub", "aud", "iat", "exp", "jti", "auth_time", "amr", "idp", "nonce", "name", "nickname", "preferred_username", "given_name", "middle_name", "family_name", "email", "email_verified", "profile", "zoneinfo", "locale", "address", "phone_number", "picture", "website", "gender", "birthdate", "updated_at", "at_hash", "c_hash"], | ||
| "code_challenge_methods_supported": ["S256"], | ||
| "introspection_endpoint": "{{request.baseUrl}}/auth/introspect", | ||
| "introspection_endpoint_auth_methods_supported": ["client_secret_basic", "client_secret_post", "client_secret_jwt", "private_key_jwt", "none"], | ||
| "revocation_endpoint": "{{request.baseUrl}}/auth/revoke", | ||
| "revocation_endpoint_auth_methods_supported": ["client_secret_basic", "client_secret_post", "client_secret_jwt", "private_key_jwt", "none"], | ||
| "end_session_endpoint": "{{request.baseUrl}}/auth/logout", | ||
| "request_parameter_supported": true, | ||
| "request_object_signing_alg_values_supported": ["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512"] | ||
| } | ||
| "keys": [ | ||
| { | ||
| "kid": "STr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xien4A+2y+trTjfImC9hIyEM+iEy9kQdB1ddMZC9PkzxQy94p2QZeIY5lBicxRLPS05rAeQXoHxP46TD7Mzat7txiNCtJZn3Y1bOdEX/SpGosWZ+vVrQMshAwOhBGcApZxW5rhnMBamzO5bQiX53gNdexc0vhZ+mzNURvvCt/XSbyQmyp8537l96AhHDiBScriKcF+J/o42+IV6b2NuFttzf3/Fj9wi2DIAw1DStChos/1XsCtGgLkVJSFxR+JhZfGS4wcEfqfhWhWppgrWPk9UdpjYr6bcl+BSPXvQw==" | ||
| ], | ||
| "x5t": "K6PhEHOchyu2P--3km64mwIct1A", | ||
| "x5t#S256": "xkRwZKknmRIiS3nQKoZk_Cw9KH01Wb-o2Qmd8Niy_FA" | ||
| }, | ||
| { | ||
| "kid": "CKB_TehGsxMsfhaFyKRAFHV9PveHT3UN0QmomB7GJgM", | ||
| "kty": "RSA", | ||
| "alg": "RS256", | ||
| "use": "sig", | ||
| "n": "xdGdCYsc3gZtGnLZkWccFlznMVrW_tzEeiflBiCHg8lhH4Tgjw8tZA4DMrueXRGJXqTbpSIjMhpapkSkYIOQV8Zg5zxSo-aahaD6FMzxFKIA7m1TGtwTpOik536Njrii_iRBiekw_o1Ua5KShN_4cptw9a8HN8aP826H_pPLQlOFCWMsMHw8taS2vt59OzRfAOf9BG4gIj56Od4XzQxI2ICNGVoZKADKNbWd0FDMEZqEoe5cDo8mGmO4ouYJpvch7InnC6VNzbJMpTt3sAyawmpAKAI9R4eW96HsUK54foLMBNjGlzKQnJIkisp6YipMqc_43EWYEhQuDa3cdpULJQ", | ||
| "e": "AQAB", | ||
| "x5c": [ | ||
| "MIICnTCCAYUCBgGO1+erTjANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDDAdvcGVudGRmMB4XDTI0MDQxMzE0MzkyN1oXDTM0MDQxMzE0NDEwN1owEjEQMA4GA1UEAwwHb3BlbnRkZjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMXRnQmLHN4GbRpy2ZFnHBZc5zFa1v7cxHon5QYgh4PJYR+E4I8PLWQOAzK7nl0RiV6k26UiIzIaWqZEpGCDkFfGYOc8UqPmmoWg+hTM8RSiAO5tUxrcE6TopOd+jY64ov4kQYnpMP6NVGuSkoTf+HKbcPWvBzfGj/Nuh/6Ty0JThQljLDB8PLWktr7efTs0XwDn/QRuICI+ejneF80MSNiAjRlaGSgAyjW1ndBQzBGahKHuXA6PJhpjuKLmCab3IeyJ5wulTc2yTKU7d7AMmsJqQCgCPUeHlveh7FCueH6CzATYxpcykJySJIrKemIqTKnP+NxFmBIULg2t3HaVCyUCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAk7RMcdoS500NL2seTQPSN0dIb1jSSskN0IPo2rmTbh2VupWuABMv3pKUzzp0LcyDdwJhdoF44g0UAzlhnqkPhBGG9H7QfGblnCSwcGX96tRsAu8f1dxlGoE1DJWay4OqNAZuSgd8/7kxaCVdK4rURhQdxW+nuO7HfeuwKpi7zFp3ubm2WVAZUAirbQ8CIS02Z5ki6q+l0rDe10RXVUUg6v0uLIF/WpsMEoLjWv7EV4E4qkRk0YYXN74o3BJgJknvyMXnUO1wb69sOFaY627jVxlksCpJ4780lOYnoqQmDXCGceggzTMrXCNOJBiSKwjndaUEseym2CNhjtNfESpdIg==" | ||
| ], | ||
| "x5t": "2poAImSunrm90ff8mrVWeCM8Jh8", | ||
| "x5t#S256": "aHHEYJnhNPkbS9DgOL6RrtMVEZLuRyefFBFZRBMJHnU" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package server | ||
|
|
||
| type StartOptions func(StartConfig) StartConfig | ||
|
|
||
| type StartConfig struct { | ||
| ConfigKey string | ||
| ConfigFile string | ||
| WaitForShutdownSignal bool | ||
| PublicRoutes []string | ||
| } | ||
|
|
||
| // Deprecated: Use WithConfigKey | ||
| func WithConfigName(name string) StartOptions { | ||
| return func(c StartConfig) StartConfig { | ||
| c.ConfigKey = name | ||
| return c | ||
| } | ||
| } | ||
|
|
||
| func WithConfigFile(file string) StartOptions { | ||
| return func(c StartConfig) StartConfig { | ||
| c.ConfigFile = file | ||
| return c | ||
| } | ||
| } | ||
|
|
||
| func WithConfigKey(key string) StartOptions { | ||
| return func(c StartConfig) StartConfig { | ||
| c.ConfigKey = key | ||
| return c | ||
| } | ||
| } | ||
|
|
||
| func WithWaitForShutdownSignal() StartOptions { | ||
| return func(c StartConfig) StartConfig { | ||
| c.WaitForShutdownSignal = true | ||
| return c | ||
| } | ||
| } | ||
|
|
||
| func WithPublicRoutes(routes []string) StartOptions { | ||
| return func(c StartConfig) StartConfig { | ||
| c.PublicRoutes = routes | ||
| return c | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.