Skip to content
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

Create custom annotation for satisfy "value" #3756

Merged
merged 1 commit into from
Feb 19, 2019

Conversation

anthonyho007
Copy link
Contributor

@anthonyho007 anthonyho007 commented Feb 11, 2019

What this PR does / why we need it:
This PR will add a new annotation for satisfy "value". An example use-case would be any application that wants to have both basic authentication + oauth proxy available to support human + bot authentication, and only requires one of those auth methods to be satisfied to get to the application.

Which issue this PR fixes
fixes # #3677

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 11, 2019
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 11, 2019
@anthonyho007 anthonyho007 changed the title [WIP]Create custom annotation for satisfy "value" Create custom annotation for satisfy "value" Feb 12, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 12, 2019
@anthonyho007
Copy link
Contributor Author

signed CLA

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 13, 2019
return Expect(server).Should(ContainSubstring("satisfy any"))
})

resp, body, errs := gorequest.New().
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be a good idea to not just see if the line appears in nginx.conf, but also check if it's actually working correctly? Say by enabling both nginx.ingress.kubernetes.io/auth-type and nginx.ingress.kubernetes.io/whitelist-source-range and checking to see if the request succeeds if it satisfies only one, but fails if it satisfies neither.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have managed to create a successful e2e test which tests this scenario with auth-type and satisfy any both enabled, and whitelist ip ranges with configuration-snippets: "allow 18.0.0.0/8; allow 56.0.0.0/8; deny all;". However, this test somehow destabilize other e2e tests which causes the e2e integration test to fail with 50% chances. For now, i will just remove this test until I could find a way to stabilize it.

Copy link
Member

@aledbf aledbf Feb 18, 2019

Choose a reason for hiding this comment

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

However, this test somehow destabilize other e2e tests which causes the e2e integration test to fail with 50% chances

We need to refactor some e2e tests to make sure we can predefine valid cidrs in any environment (some test work fine in minikube but not in e2e that uses a different environment to configure the cluster)


### Satisfy

By default, request would need to satisfy all authentications requirements in order to be allow. By using this annotation, it would allow requests to satisfy any or all authentication requirements based on the configuration value.
Copy link
Contributor

Choose a reason for hiding this comment

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

Some grammar/phrasing nitpicks: Say

By default, a request would need to satisfy all authentication requirements in order to be allowed. By using this annotation, requests that satisfy either any or all authentication requirements are allowed, based on the configuration value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@anthonyho007 anthonyho007 changed the title Create custom annotation for satisfy "value" [WIP]Create custom annotation for satisfy "value" Feb 15, 2019
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 15, 2019
@anthonyho007 anthonyho007 changed the title [WIP]Create custom annotation for satisfy "value" Create custom annotation for satisfy "value" Feb 18, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 18, 2019
@aledbf
Copy link
Member

aledbf commented Feb 18, 2019

@anthonyho007 please squash the commits

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 18, 2019
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 18, 2019
@ElvinEfendi
Copy link
Member

@anthonyho007 this is looking 👍 now! Please squash your commits then we can merge this.

@ElvinEfendi
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 19, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anthonyho007, ElvinEfendi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 19, 2019
@k8s-ci-robot k8s-ci-robot merged commit 43cfbb9 into kubernetes:master Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants