Skip to content

Conversation

@louis-murray
Copy link

No description provided.

@k8s-ci-robot
Copy link
Contributor

Welcome @louis-murray!

It looks like this is your first PR to kubernetes-client/javascript 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-client/javascript has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@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 Aug 26, 2019
@louis-murray
Copy link
Author

I have signed the cla

@louis-murray
Copy link
Author

related to #294

@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 Aug 26, 2019
@louis-murray
Copy link
Author

ok, I had to set the openid-client package to version 2.5.0, same version used by the go daddy kube client, to support node 8.

@louis-murray
Copy link
Author

/assign @brendandburns

@louis-murray
Copy link
Author

/check-cla

1 similar comment
@louis-murray
Copy link
Author

/check-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 Aug 26, 2019
src/oidc_auth.ts Outdated
return this.refresh(user, client);
}

private async refresh(user: User, client): Promise<string> {
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't client have a type?

Copy link
Author

Choose a reason for hiding this comment

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

it definitely should. the public types for the oidc client are missing a reference to the only function was actually call on it. I just opened a PR to fix that DefinitelyTyped/DefinitelyTyped#37968

@brendandburns
Copy link
Contributor

Thanks for the PR! Minor comments. Please also squash everything into one single commit.

Thanks!

@louis-murray
Copy link
Author

thanks for the feedback! I think I touched on everything you brought up. the only thing I don't have an immediate resolution for is the client types.

src/oidc_auth.ts Outdated

export class OpenIDConnectAuth implements Authenticator {
// public for testing purposes.
public currentTokenExpiration = 0;
Copy link
Contributor

@brendandburns brendandburns Aug 28, 2019

Choose a reason for hiding this comment

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

nit: instead of making this public you can use:

(oidcAuth as any).currentTokenExpiration = <foo>;

in the test code. I think that's preferable vs exposing this as public.

Copy link
Author

Choose a reason for hiding this comment

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

that's slick, I'll make that change

@brendandburns
Copy link
Contributor

Thanks, way cleaner! one minor comment about how you can expose private variables to tests w/o changing their visibility in the class.

Thanks again!

openid token management impl

oidc token management

implement oidc token refreshing

add openid-client

add oidc refresh logic

add tests for oidc logic

introspect needs special urls so removing

updated tests to reflect introspect not being able to be used

prettier changes

chore: use a version of open-id client that supports node 8

fix id-token ref to id_token

update token expiration to be more flexible

replace the tokenExp with tokenExpirationCache

update if for first time interaction with a user

replace token expiration map with single expiration

update test descriptions to be more accurate

correct test to set initial expiration

add oidc types

reference types in class

cast any so we can keep properties private

prettier

use expires_at over expiration
@louis-murray
Copy link
Author

just updated based on your comments, I also added the updated types for oidc and replaced the call when setting the currentTokenExpiration from newToken.expiration to newToken.expires_at because I realized the oidc spec defines expires_atas the standard and expiration is just something that is implementation dependent

@brendandburns
Copy link
Contributor

/lgtm
/approve

Thanks for the patience!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns, louis-murray

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 Sep 2, 2019
@k8s-ci-robot k8s-ci-robot merged commit 74ed0f5 into kubernetes-client:master Sep 2, 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants