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

feat: allow arbitrary length API tokens #724

Merged
merged 3 commits into from
Oct 7, 2024
Merged

Conversation

kamushadenes
Copy link
Contributor

@kamushadenes kamushadenes commented Sep 28, 2024

Context

We have developed a soon-to-be-open-source proxy that forces specific labels in order to provide scoped API access, and that doesn't expose the real API token. This was created to have better control of resources inside the same project (as API tokens currently lack granularity), and to be able to use a single project securely, given that it isn't possible to create a project via the API.

One of it's operating modes is using JWT as a virtual self-validating token, which can't have a fixed size.

This support is required to make full use of it inside a Kubernetes cluster.

The feature is behind a default-false flag so it shouldn't interfere with current behavior.

Related

kubernetes/autoscaler#7285
hetznercloud/hcloud-cloud-controller-manager#752

@kamushadenes kamushadenes requested a review from a team as a code owner September 28, 2024 01:24
@kamushadenes kamushadenes changed the title Allow arbitrary length API token behind a flag Allow arbitrary length API token Oct 7, 2024
@apricote apricote changed the title Allow arbitrary length API token feat: allow arbitrary length API tokens Oct 7, 2024
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 34.54%. Comparing base (274a3ab) to head (9a9d178).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/app/app.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #724   +/-   ##
=======================================
  Coverage   34.54%   34.54%           
=======================================
  Files          19       19           
  Lines        1621     1621           
=======================================
  Hits          560      560           
  Misses       1027     1027           
  Partials       34       34           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@apricote apricote merged commit 61c3a0e into hetznercloud:main Oct 7, 2024
4 of 8 checks passed
lukasmetzner pushed a commit that referenced this pull request Oct 10, 2024
We[0] have developed a soon-to-be-open-source proxy that forces
specific labels in order to provide scoped API access, and that doesn't
expose the real API token. This was created to have better control of
resources inside the same project (as API tokens currently lack
granularity), and to be able to use a single project securely, given that
it isn't possible to create a project via the API.

One of it's operating modes is using JWT as a virtual self-validating
token, which can't have a fixed size.

This support is required to make full use of it inside a Kubernetes
cluster.

As the upstream Hetzner Cloud tokens might also change in length in
the future, the error was changed to a warning log.

[0] https://github.com/altinity
lukasmetzner pushed a commit that referenced this pull request Oct 29, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.10.0](v2.9.0...v2.10.0)
(2024-10-29)


### Features

* add support & tests for Kubernetes 1.31
([#721](#721))
([85035b9](85035b9))
* allow arbitrary length API tokens
([#724](#724))
([61c3a0e](61c3a0e))
* allow passing mkfs format options via storage class parameters
([#747](#747))
([4b9aa4e](4b9aa4e))
* change XFS default options to support older kernels
([#747](#747))
([4b9aa4e](4b9aa4e))
* drop tests for Kubernetes 1.27
([#722](#722))
([d46a54b](d46a54b))
* force pods with volumes to be scheduled on Cloud servers
([#743](#743))
([702fe01](702fe01))
* fstype is directly passed to mkfs: mkfs.<fstype>
([#749](#749))
([173bf2f](173bf2f))
* support for SELinux mount
([#756](#756))
([719247e](719247e)),
closes [#582](#582)
* Support SINGLE_NODE_MULTI_WRITER capability
([#725](#725))
([cd53c23](cd53c23)),
closes [#327](#327)
* **swarm:** removed workaround support for mock staging/unstaging
([#746](#746))
([465ec21](465ec21))


### Bug Fixes

* do not log sensitive mount options
([#755](#755))
([0b6e860](0b6e860))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
lukasmetzner pushed a commit that referenced this pull request Nov 11, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.10.0](v2.9.0...v2.10.0)
(2024-10-29)


### Features

* add support & tests for Kubernetes 1.31
([#721](#721))
([85035b9](85035b9))
* allow arbitrary length API tokens
([#724](#724))
([61c3a0e](61c3a0e))
* allow passing mkfs format options via storage class parameters
([#747](#747))
([4b9aa4e](4b9aa4e))
* change XFS default options to support older kernels
([#747](#747))
([4b9aa4e](4b9aa4e))
* drop tests for Kubernetes 1.27
([#722](#722))
([d46a54b](d46a54b))
* force pods with volumes to be scheduled on Cloud servers
([#743](#743))
([702fe01](702fe01))
* fstype is directly passed to mkfs: mkfs.<fstype>
([#749](#749))
([173bf2f](173bf2f))
* support for SELinux mount
([#756](#756))
([719247e](719247e)),
closes [#582](#582)
* Support SINGLE_NODE_MULTI_WRITER capability
([#725](#725))
([cd53c23](cd53c23)),
closes [#327](#327)
* **swarm:** removed workaround support for mock staging/unstaging
([#746](#746))
([465ec21](465ec21))


### Bug Fixes

* do not log sensitive mount options
([#755](#755))
([0b6e860](0b6e860))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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