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

effectful authorization header #174

Merged
merged 1 commit into from
Dec 17, 2022
Merged

Conversation

yurique
Copy link
Collaborator

@yurique yurique commented Dec 3, 2022

(this is the first of two PRs addressing the challenge described below, link to the second one is at the bottom)

A big thing that is happening in the k8s world is the release of Kubernetes 1.21, in which BoundServiceAccountTokenVolume got graduated to beta and is enabled by default. In particular, it will be enabled and used in AWS hosted k8s.

Release notes: https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html#kubernetes-1.21 (see the first Important banner).

In short, this means that the auth token available within the cluster (in /var/run/secrets/kubernetes.io/serviceaccount/token) will now have an expiration time.

This means that we can no longer provide a token upon creation of the KubeConfig and expect it to work (it might expire in an hour or in a minute – we don't know).

This PR introduces a change to the way KubeConfig is created (when providing a token): the user will need to provide a token inside an F[_] and the client will evaluate it every time it needs a token.

If the user wants to keep the previous behaviour, they can provide theToken.pure[F].

Most of the files here have been changed solely because KubeConfig now has a type parameter:

case class KubeConfig[F[_]] private (
    ...
    authorization: Option[F[Authorization]],
    ...

The second PR is built on top of this one and introduces more functionality related to this matter, as well as some improvements: #173

@yurique yurique mentioned this pull request Dec 3, 2022
5 tasks
@yurique yurique marked this pull request as ready for review December 3, 2022 18:26
@joan38 joan38 merged commit 8cec0fc into joan38:main Dec 17, 2022
@joan38
Copy link
Owner

joan38 commented Dec 17, 2022

Thanks @yurique !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants