Skip to content

Implement a way to time out tokens based on (in)activity#17161

Closed
simo5 wants to merge 350 commits intoopenshift:masterfrom
simo5:tokentimeout
Closed

Implement a way to time out tokens based on (in)activity#17161
simo5 wants to merge 350 commits intoopenshift:masterfrom
simo5:tokentimeout

Conversation

@simo5
Copy link
Contributor

@simo5 simo5 commented Nov 2, 2017

When OAuthClient is configure with accessTokenTimeoutSeconds then tokens obtained with the specific client get a TimeoutsIn field that marks when the token is to be considered timed out.
The timeout is in seconds since token CreationTimestamp
As the token is used it is pushed into a bucket which is regularly flushed (for now).

smarterclayton and others added 30 commits October 27, 2017 07:42
Having two different types internally and externally was not useful, and
made it harder to keep the types in sync and reason about their
conversions.
A test deployment is a deployment that is scaled to zero when it is
not running. Once the deployment reaches a terminal state its RC is
scaled to zero, and any pods are deleted. This allows the deployment to
be a test or validation environment - triggering each time a new image
is created, and ensuring that everything goes smoothly. Hooks can be
added to test function, or can pause for arbitrary periods of time in
order give the user time to test the function.

The scale number on the deployment config is considered primary - during
reconciliation of test deployment configs any changes to individual
RCs are ignored.
The 90% case for hooks is running a migration - if that requires the
service to be down, that won't work for either pre or post deployments.
Add a "mid" deployment hook that runs on recreate strategy while all
containers are stopped.
The recreate strategy did not previously use readiness checks. This
commit adds support for them in order to make the new mid check pass
(failing-dc-mid.yaml relies on recreate readiness failing in order to
fail the deployment).
When a router sees a route, it should make a decision about the name it
wishes to assign to that route (based on its override-hostname or own
settings) and then write the decision back to the route status with an
effective host value (so clients can see what the actual route value
is). If multiple routers attempt to make conflicting writes, have them
remember the conflict so as to avoid battles as they race to the new
value. Errors due to route uniqueness are also written back to the
status.

Each route has an array of RouteIngress structs, which contain an array
of conditions, the routerName (passed via --name to the router), and the
effective host.

Add printers and describers, make ingress empty be a special case.
Also return the latest spec/conditions/generations for the tag. Add
validation to the appropriate code.
The lifecycle hook in the deploy api can be used to tag the image used
in a deployment to another image stream tag. Requires that the image
stream already exist. May not be specified at the same time as
execNewPod.
This is meant to be used for running project unit tests as part of a
build.

Changes:
- Add utility to run containers and stream logs
- Add build spec API field for post commit actions

  Includes a common-case API for running a shell script and an
  kapi.Container-like API for more sophisticated use cases.

A good deal of this was done pair programming with @PI-Victor.
We need either `/bin/bash -c` or `/bin/sh -ic` to make our supported
SCL-powered images to work properly. That's due to a hack to auto-enable
SCLs:
https://github.com/openshift/sti-base/blob/8d95148/Dockerfile#L23-L29

In CentOS and RHEL images, `/bin/sh` is a symlink to `/bin/bash`. In
that case, the ENV environment variable is only evaluated when the shell
is started in interactive mode, which happens when there's and attached
tty (not the case for post build hook) or when the `-i` argument is
passed explicitly.

Making the shell interactive with `-i` is ugly, but is the only solution
we know so far without requiring Bash.
Formatting changed to read better in generated docs.
Add generation numbers to deploymentconfigs. Helpful for decoupling
latestVersion from oc
Add a separete call for updating the status of a deploymentconfig.
Use it where it makes sense (controllers should be responsible for
updating the status).

Also make spec updates tolerate status detail updates in case the
updates originates from the image change controller.
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 29, 2017
deads2k and others added 3 commits November 29, 2017 13:27
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: simo5
We suggest the following additional approver: pweil-

Assign the PR to them by writing /assign @pweil- in a comment when ready.

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

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added vendor-update Touching vendor dir or related files and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 30, 2017
Adds Timeout interval configuration for Oauth clients.
@simo5 simo5 closed this Dec 5, 2017
@openshift-ci-robot openshift-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 Dec 5, 2017
@openshift-ci-robot
Copy link

@simo5: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_conformance_install_update f0f86b7 link /test extended_conformance_install_update
ci/openshift-jenkins/cross 2993e75 link /test cross
ci/openshift-jenkins/integration b731b4e link /test integration
ci/openshift-jenkins/verify b731b4e link /test verify
ci/openshift-jenkins/extended_conformance_gce b731b4e link /test extended_conformance_gce
ci/openshift-jenkins/unit b731b4e link /test unit
ci/openshift-jenkins/end_to_end b731b4e link /test end_to_end
ci/openshift-jenkins/cmd b731b4e link /test cmd
ci/openshift-jenkins/extended_networking_minimal b731b4e link /test extended_networking_minimal
ci/openshift-jenkins/extended_conformance_install b731b4e link /test extended_conformance_install

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.

Details

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.

@simo5 simo5 deleted the tokentimeout branch December 6, 2017 19:24
@simo5
Copy link
Contributor Author

simo5 commented Dec 6, 2017

Ok so github decided to tombstone this PR after an accidental push of mine, so will have to open a new PR.
SAD

openshift-merge-robot added a commit that referenced this pull request Jan 9, 2018
Automatic merge from submit-queue.

Implement a way to time out tokens based on (in)activity 

When OAuthClient is configure with accessTokenTimeoutSeconds then tokens obtained with the specific client get a TimeoutsIn field that marks when the token is to be considered timed out.
The timeout is in seconds since token CreationTimestamp
As the token is used it is pushed into a bucket which is regularly flushed (for now).

This replaces #17161 which github inexplicably and unilaterally decided to close after a wrong push (can't be reopened)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-api-review size/L Denotes a PR that changes 100-499 lines, ignoring generated files. vendor-update Touching vendor dir or related files

Projects

None yet

Development

Successfully merging this pull request may close these issues.