You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
This file contains 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
Change allows to set basic authentication security option on an API Definition deployed using the tyk-operator.
Change allows only for simple setting of basic authentication option using default configuration. It does not allow setting additional basic auth metadata.
Basic authentication was on the list of not implemented features.
Test Coverage For This Change
Added unit test TestApiDefinitionBasicAuth in apidefinition_test.go followin a simillar strcuture to the mtls configuration.
Added config/samples/basic-auth/httpbin_basic_authentication.yaml
Executed manual tests on kind cluster using ce and pro modes
$ kubectl apply -f config/samples/basic-auth/httpbin_basic_authentication.yaml
$ apidefinition.tyk.tyk.io/httpbin-basic-auth created
$ curl http://localhost:8080/httpbin/headers
{
"error": "Authorization field missing"
}
Screenshots (if appropriate)
Types of changes
Bug fix (non-breaking change which fixes an issue)
[X ] New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Checklist
Make sure you are requesting to pull a topic/feature/bugfix branch (right side). If PRing from your fork, don't come from your master!
Make sure you are making a pull request against our master branch (left side). Also, it would be best if you started your change off our latest master.
Make sure you are updating CHANGELOG.md based on your changes.
My change requires a change to the documentation.
If you've changed APIs, describe what needs to be updated in the documentation.
I have updated the documentation accordingly.
If you've changed API models, please update CRDs.
make manifests
make helm
I have added tests to cover my changes.
All new and existing tests passed.
Check your code additions will not fail linting checks:
Thank you @bogumillaska for the PR.
I really like that you added integration tests for your changes! I want to get a feedback on it. Are they easy to write and understand?
Was there any reason for not enabling basic auth metadata fields?
Hi @komalsukhani
Yes - they were very easy to do. Mostly because mTLS option have an almost identical check. I guess it could be even extracted to some common functions because of those similarities. But I am just beginning my golang and tyk-operator journey so I did not do that at this time.
I left out metadata so far because of time restrictions. We are using basic authentication on the project and we wanted that capability - but so far we dont use any metadata.
We still want to add support for tag-headers and then if time permits we could think about adding metadata as a separate PR.
However - if you consider metadata a must to accept this PR then I can add that of course.
We still want to add support for tag-headers and then if time permits we could think about adding metadata as a separate PR.
I think we do support tag-headers
We still want to add support for tag-headers and then if time permits we could think about adding metadata as a separate PR.
I think we do support tag-headers
I resolved all the comments.
Also - I confirm - tag headers seems to work - and they seems to be there for quite some time already - is api_definition.md mentioning some other functionality or it simply needs and update ?
I resolved all the comments. Also - I confirm - tag headers seems to work - and they seems to be there for quite some time already - is api_definition.md mentioning some other functionality or it simply needs and update ?
Thank you!
api_definition.md file needs an update.
@bogumillaska Will add your PR in our sprint. Once QA tests it, we will merge it to master.
Also, Next operator release is planned for end of the month.
One last thing from my side.
Can you run make manifests and make helm and commit changed files?
These commands will update the description of the field in the CRD definition and helm charts.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
4 participants
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.
Description
Change allows to set basic authentication security option on an API Definition deployed using the tyk-operator.
Change allows only for simple setting of basic authentication option using default configuration. It does not allow setting additional basic auth metadata.
Related Issue
TT-7112 Add Basic Authentication option to ApiDefinition CRD
Motivation and Context
Basic authentication was on the list of not implemented features.
Test Coverage For This Change
Added unit test TestApiDefinitionBasicAuth in apidefinition_test.go followin a simillar strcuture to the mtls configuration.
Added config/samples/basic-auth/httpbin_basic_authentication.yaml
Executed manual tests on kind cluster using ce and pro modes
Screenshots (if appropriate)
Types of changes
Checklist
master
!master
branch (left side). Also, it would be best if you started your change off our latestmaster
.make manifests
make helm
gofmt -s -w .
go vet ./...
golangci-lint run