Skip to content

Conversation

zherman0
Copy link
Member

Add validation for logout redirect for the console CRD
1. Validation in the CRD to test that well formed URLs are supplied
a) https://www.redhat.com:8080/logout.html is valid
b) http://www.redhat.com is invalid because it is insecure
c) www.redhat.com is invalid

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 28, 2019
@benjaminapetersen
Copy link
Contributor

@zherman0
Copy link
Member Author

/assign deads2k enj

authentication:
properties:
logoutRedirect:
pattern: ^$|^((https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))$
Copy link
Contributor

Choose a reason for hiding this comment

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

Testing this with a regex tester:

https://foobar                              // valid, probably should not be?
https://redhat.com/#foo             // valid, i dont think we care about fragments
https://redhat.com?red=hat       // valid, i dont think we care about query strings

already stated in prev comment:

https://www.redhat.com:8080/logout.html  // valid
http://www.redhat.com                                   // invalid
www.redhat.com is invalid                              // invalid

Copy link
Member

Choose a reason for hiding this comment

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

https://foobar // valid, probably should not be?

Is there a reason we would require a path? I'd think this is OK

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted https://localhost to work

Copy link
Contributor

Choose a reason for hiding this comment

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

@spadgett I was more commenting on the .<something>.
localhost does seem a valid point.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 8, 2019
@zherman0 zherman0 force-pushed the validation-logout branch from 05e7b97 to cf6a1eb Compare March 8, 2019 16:35
@openshift-ci-robot openshift-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 8, 2019
@benjaminapetersen
Copy link
Contributor

make verify doesn't like the pattern:

--- manifests/0000_05_config-operator_01_console.crd.yaml	2019-03-08 16:36:01.000000000 +0000
+++ /go/src/github.com/openshift/cluster-config-operator/101316955/0000_05_config-operator_01_console.crd.yaml	2019-03-08 16:37:50.753525862 +0000
@@ -38,7 +38,6 @@
             authentication:
               properties:
                 logoutRedirect:
-                  pattern: ^$|^((https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))$
                   description: 'An optional, absolute URL to redirect web browsers
                     to after logging out of the console. If not specified, it will
                     redirect to the default login page. This is required when using

@zherman0
Copy link
Member Author

I need openshift/api#249 to merge first before the verify test will pass.

@zherman0 zherman0 force-pushed the validation-logout branch from cf6a1eb to 5278d9c Compare March 18, 2019 15:07
@deads2k
Copy link
Contributor

deads2k commented Mar 18, 2019

this doesn't look right. You should need to re-vendor openshift/api and regenerate, rigth?

@zherman0
Copy link
Member Author

We will need to bump the deps now that api/pr249 has merged for this to pass

@benjaminapetersen
Copy link
Contributor

@zherman0

# usually works
make update-deps && make generate && make verify
# but I think the deps update is manual in this repo, probably something like
glide update --strip-vendor && make update-codegen && make verify

@zherman0
Copy link
Member Author

zherman0 commented Apr 5, 2019

/test verify

@zherman0 zherman0 force-pushed the validation-logout branch from 5278d9c to 00af35f Compare April 5, 2019 15:12
@zherman0 zherman0 force-pushed the validation-logout branch from 00af35f to 8efa339 Compare April 5, 2019 15:21
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zherman0

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 5, 2019
@zherman0
Copy link
Member Author

zherman0 commented Apr 5, 2019

This update to the manifest was automatically done when the vendor apis was bumped and the pattern auto created. Therefore, closing this ticket.

@zherman0 zherman0 closed this Apr 5, 2019
@openshift-ci-robot
Copy link

@zherman0: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws 8efa339 link /test e2e-aws

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@zherman0 zherman0 deleted the validation-logout branch April 5, 2019 17:28
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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants