{"action":"created","issue":{"url":"https://api.github.com/repos/godaddy/kubernetes-client/issues/328","repository_url":"https://api.github.com/repos/godaddy/kubernetes-client","labels_url":"https://api.github.com/repos/godaddy/kubernetes-client/issues/328/labels{/name}","comments_url":"https://api.github.com/repos/godaddy/kubernetes-client/issues/328/comments","events_url":"https://api.github.com/repos/godaddy/kubernetes-client/issues/328/events","html_url":"https://github.com/godaddy/kubernetes-client/issues/328","id":358837539,"node_id":"MDU6SXNzdWUzNTg4Mzc1Mzk=","number":328,"title":"Mechanism to refresh token","user":{"login":"baldred","id":25916533,"node_id":"MDQ6VXNlcjI1OTE2NTMz","avatar_url":"https://avatars2.githubusercontent.com/u/25916533?v=4","gravatar_id":"","url":"https://api.github.com/users/baldred","html_url":"https://github.com/baldred","followers_url":"https://api.github.com/users/baldred/followers","following_url":"https://api.github.com/users/baldred/following{/other_user}","gists_url":"https://api.github.com/users/baldred/gists{/gist_id}","starred_url":"https://api.github.com/users/baldred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baldred/subscriptions","organizations_url":"https://api.github.com/users/baldred/orgs","repos_url":"https://api.github.com/users/baldred/repos","events_url":"https://api.github.com/users/baldred/events{/privacy}","received_events_url":"https://api.github.com/users/baldred/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-11T00:02:16Z","updated_at":"2018-09-17T14:30:34Z","closed_at":null,"author_association":"NONE","body":"I'm wondering if there is any way we can use this kubernetes-client module to refresh authentication token when **auth-provider** is **oidc**. Below is the snippet of my kubeconfig (it's testing environment so it's okay to share in plaintext).\r\n\r\n```\r\nauth-provider:\r\n      name: oidc\r\n      config:\r\n        client-id: bx\r\n        client-secret: bx\r\n        id-token: eyJraWQiOiIyMDE3MTAzMC0wMDowMDowMCIsImFsZyI6IlJTMjU2In0.eyJpYW1faWQiOiJJQk1pZC0zMTAwMDIxMlcxIiwiaXNzIjoiaHR0cHM6Ly9pYW0ubmcu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94y_E8leEy_sreVtU-U4k5RfovIevn6nBj7_b7Dc55-Q-pxjFov2LRGF1Xmhr3m4RVMmtSnzvVYcvTLDDSfjd2aXpEBjhd2Ht8f7HMF4K63_QIG_rpXuWI_OsyXPzd9x-I8vr-kRt_qWpTEG71OcOlONwKbsSZgSQtpPCllL4lvySBL4UvHz4re7tntOX0buCLnFwDy_EQthvyR6LIk37XTlv_Bp4OJPN2DNYgr0P6CRtGNCHmH7lwksfF_AeAbj4wV2albLHN36H3QKa0dpGV3q_Ob8BWT9jg83-H11-AEyLIDBp-QcbJyHgUI4LN93yp3aHl1TxPfPBI8nU46fp0q8MU7ftbgXmE1M3z29ZlN119goEYhlvRoFaB6XujUz9hrdjTws0RuFMGjciKn3JWdhcQUaT-tt8ys4JqC4IcLP7E44tI1qqHuy7bZ3pMOYIzi5ovytcK3qVOZP0BDINGDNVzi31KyCyRLbGYBVRHBSZipnfdKW06fCr8LdNc4U\r\n```\r\n\r\nI took at a look at the code (https://github.com/godaddy/kubernetes-client/blob/master/lib/request.js). It seems to me that there is a mechanism for refresh. But if I load kubeconfig with expired token, the request will just time-out:\r\n\r\n```\r\n(node:12517) UnhandledPromiseRejectionWarning: AggregateError: \r\n    RequestError: Request timed out\r\nat timeoutFn (/Users/aldred/Workspace/blockchain/kubernetes-api/node_modules/got/index.js:333:53)\r\n        at asPromise (/Users/aldred/Workspace/blockchain/kubernetes-api/node_modules/got/index.js:411:18)\r\n```"},"comment":{"url":"https://api.github.com/repos/godaddy/kubernetes-client/issues/comments/422040250","html_url":"https://github.com/godaddy/kubernetes-client/issues/328#issuecomment-422040250","issue_url":"https://api.github.com/repos/godaddy/kubernetes-client/issues/328","id":422040250,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjA0MDI1MA==","user":{"login":"silasbw","id":1919311,"node_id":"MDQ6VXNlcjE5MTkzMTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1919311?v=4","gravatar_id":"","url":"https://api.github.com/users/silasbw","html_url":"https://github.com/silasbw","followers_url":"https://api.github.com/users/silasbw/followers","following_url":"https://api.github.com/users/silasbw/following{/other_user}","gists_url":"https://api.github.com/users/silasbw/gists{/gist_id}","starred_url":"https://api.github.com/users/silasbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silasbw/subscriptions","organizations_url":"https://api.github.com/users/silasbw/orgs","repos_url":"https://api.github.com/users/silasbw/repos","events_url":"https://api.github.com/users/silasbw/events{/privacy}","received_events_url":"https://api.github.com/users/silasbw/received_events","type":"User","site_admin":false},"created_at":"2018-09-17T14:30:34Z","updated_at":"2018-09-17T14:30:34Z","author_association":"MEMBER","body":"hey @baldred, thanks for tracking this down.  So, the problem you're seeing is that the default timeout value is too small for your needs, and your refresh request is timing out?  We should def fix that -- I'm wondering if it's by hardcoding a value, like your patch does; or by providing a way to configure it.\r\n\r\nOne approach would be to extend https://github.com/godaddy/kubernetes-client/blob/master/lib/request.js#L40 with a timeout option and pass that value through the auth backend.  You need to pass the timeout value when constructing your kubernetes-client instance.  Would something like that work for you?"}}
{"actor":{"display_login":"silasbw"}}