-
Notifications
You must be signed in to change notification settings - Fork 154
Add support for Basic Auth through AuthenticationFilter #4436
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
Open
shaun-nx
wants to merge
51
commits into
feat/authentication-filter-basic-auth
Choose a base branch
from
feat/basic-auth
base: feat/authentication-filter-basic-auth
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 37 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
bb4607a
Add support for Basic Auth through AuthenticationFilter
shaun-nx 23ab285
Merge branch 'feat/authentication-filter-basic-auth' into feat/basic-…
shaun-nx 0a48fff
make generate-all
shaun-nx 0e5f51e
Set dest from `location.AuthBasic.Data.FileName`
shaun-nx 5a4903c
Update dest value
shaun-nx e35da99
Remove duplicate call to secret resolved
shaun-nx 1b7dd25
Remove duplicate call to secret resolver
shaun-nx edb8348
Re-add removed comment
shaun-nx 816382d
Process custom secret type
shaun-nx 3fa25c0
Update basicAuthUserFile const
shaun-nx d2f170b
Ensure secrets are resolved
shaun-nx a681ba5
Resolve nil pointer error
shaun-nx 5effdbc
Remove redundant error handling
shaun-nx b8f26a6
Do not resolve Opaque secrets
shaun-nx 50dfd77
Add secret namespace to file path
shaun-nx 5b6ccd1
Update status variable name
shaun-nx 12d6e54
Update logic for generating auth basic user file
shaun-nx a341ea4
Update AuthBasic struct. Remove debug log lines
shaun-nx 2e57114
Resolve lint errors
shaun-nx 2a43510
Add additional comments
shaun-nx d66aebe
Add comment for AuthBasic struct
shaun-nx 918edc8
Update unit tests for generator
shaun-nx adba89a
Ensure only one AuthenticationFilter can be referenced per route rule
shaun-nx c756ad8
Update servers_test with test case for AuthenticationFilter
shaun-nx 2eee38d
Update format of filename for auth_basic_user_file
shaun-nx 2eb1ae0
go mod tidy
shaun-nx 9d9fef4
Fix unit test for generator
shaun-nx 7136d40
Add test case to configuration test
shaun-nx 40f5ebb
Add unit tests for convertAuthenticationFilter
shaun-nx 1fab2fa
Add unit tests for `graph/authentication_filter.go`
shaun-nx aa75856
Fix lint errors and update test assertion
shaun-nx ffc8867
Remove formatting var
shaun-nx 523d5a5
Unit tests for common_filter, extensions_ref_filter and httproute
shaun-nx 4044987
Update comments in test
shaun-nx 05e7ee8
Unit tests for grpcroute
shaun-nx 04b3983
Enesure resolved secrets map is updated for each case. Update unit tests
shaun-nx d4b7f59
Unit tests for prepare_requests and status_setters
shaun-nx f50ea25
Add function to genereate file name for auth basic file
shaun-nx 3647812
Remove duplicate function in tests
shaun-nx f83e853
Set lenght to maps. Remove duplicate entries
shaun-nx 3f7c232
Restore comments for HTTPFilters struct
shaun-nx ee63844
Update comment for AuthenticationFilter in HTTPFilters struct
shaun-nx 1912215
Update occurrances of UserFile and UserData to File and FileData
shaun-nx feb0469
Deduplicate refernces to resolves secrets map
shaun-nx 1e2e7c0
Add t.Parallel() to test run
shaun-nx c71fc54
Add t.Parallel() and move AuthenticationFilter into correct const block
shaun-nx a2bc05f
Fix lint errors
shaun-nx 9ae699a
Re-add comments removed by linter
shaun-nx 9dbcc7c
Preserve field order (govet) in HTTPFilters struct
shaun-nx 50125ba
Add longer timeout to conformance test run
shaun-nx 4636466
Fix field order for HTTPFilters
shaun-nx 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
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
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
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 |
|---|---|---|
|
|
@@ -133,6 +133,9 @@ func (g GeneratorImpl) Generate(conf dataplane.Configuration) []agent.File { | |
| files = append(files, generateCertBundle(id, bundle)) | ||
| } | ||
|
|
||
| for id, data := range conf.AuthBasicSecrets { | ||
| files = append(files, generateAuthBasicUserFile(id, data)) | ||
| } | ||
| return files | ||
| } | ||
|
|
||
|
|
@@ -252,3 +255,19 @@ func generateCertBundle(id dataplane.CertBundleID, cert []byte) agent.File { | |
| func generateCertBundleFileName(id dataplane.CertBundleID) string { | ||
| return filepath.Join(secretsFolder, string(id)+".crt") | ||
| } | ||
|
|
||
| func generateAuthBasicUserFile(id dataplane.AuthBasicUserFileID, data []byte) agent.File { | ||
|
||
| return agent.File{ | ||
| Meta: &pb.FileMeta{ | ||
| Name: generateAuthBasicUserFileName(id), | ||
| Hash: filesHelper.GenerateHash(data), | ||
| Permissions: file.SecretFileMode, | ||
| Size: int64(len(data)), | ||
| }, | ||
| Contents: data, | ||
| } | ||
| } | ||
|
|
||
| func generateAuthBasicUserFileName(id dataplane.AuthBasicUserFileID) string { | ||
| return filepath.Join(secretsFolder, string(id)) | ||
| } | ||
Oops, something went wrong.
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.