Skip to content

ROX-20100: Add machine to machine auth api#8145

Merged
dhaus67 merged 18 commits intomasterfrom
master-dh/rox-20100-machine-to-machine-api
Oct 25, 2023
Merged

ROX-20100: Add machine to machine auth api#8145
dhaus67 merged 18 commits intomasterfrom
master-dh/rox-20100-machine-to-machine-api

Conversation

@dhaus67
Copy link
Contributor

@dhaus67 dhaus67 commented Oct 13, 2023

Description

This is the first PR in a series of PRs for ROX-20100.

The goal of ROX-20100 is to provide users with the ability to exchange their identity tokens from third-party OIDC providers for a Central access token, without requiring to create an API token integration.

The most prevalent use-case we currently have in mind is for things like Continuous integration environments (e.g. GitHub actions). For more details on the overall feature, its envisioned use-cases and scope, see the ticket.

The first PR in the series establishes the proto API spec, as well as the service, datastore, and store layer. The name of the API is now /v1/auth/m2m, where m2m stands for machine to machine, as this is in theory the auth flow being used (since we envision this to be used primarily by non-interactive flows, machine to machine fits).

The configuration currently consists of:

  • a specific type, defaulting to GitHub actions or providing a different issuer.
  • a list of mappings, where each mapping is essentially the equivalent of auth provider groups, where a key value from the identity token's claims will be mapped to a specific role.

The reason why a dedicated type for GitHub actions was used is: simplicity. This somewhat mirrors what we have for the Image integrations, where there is Docker generic but also all different types of image integrations.
This makes it easier to later on create this configuration from the API, without knowning e.g. the issuer for GitHub actions by searching through the docs.

The current scope of the PR is limited to establishing the API, datastore, service layer without actually implementing the token exchange yet, this will be done in the follow-up PR.

Checklist

  • Investigated and inspected CI test results
  • Unit test and regression tests added
  • Evaluated and added CHANGELOG entry if required
  • Determined and documented upgrade steps
  • Documented user facing changes (create PR based on openshift/openshift-docs and merge into rhacs-docs)

If any of these don't apply, please comment below.

Testing Performed

Here I tell how I validated my change

  • see the added unit tests on the datastore layer to test basic functionality.

Reminder for reviewers

In addition to reviewing code here, reviewers must also review testing and request further testing in case the
performed one does not seem sufficient. As a reviewer, you must not approve the change until you understand the
performed testing and you are satisfied with it.

@openshift-ci
Copy link

openshift-ci bot commented Oct 13, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@dhaus67
Copy link
Contributor Author

dhaus67 commented Oct 13, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@ghost
Copy link

ghost commented Oct 13, 2023

Images are ready for the commit at b1b0bf2.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.2.x-563-gb1b0bf2247.

@dhaus67 dhaus67 force-pushed the master-dh/rox-20100-machine-to-machine-api branch from 9fd67f7 to c02655f Compare October 13, 2023 19:03
@dhaus67 dhaus67 requested a review from msugakov October 13, 2023 19:03
@dhaus67 dhaus67 marked this pull request as ready for review October 13, 2023 19:03
@dhaus67 dhaus67 requested a review from a team as a code owner October 13, 2023 19:03
@dhaus67 dhaus67 force-pushed the master-dh/rox-20100-machine-to-machine-api branch from c02655f to f8f01fb Compare October 13, 2023 19:59
@dhaus67 dhaus67 mentioned this pull request Oct 14, 2023
5 tasks
@dhaus67 dhaus67 force-pushed the master-dh/rox-20100-machine-to-machine-api branch from acf1c82 to 09b4eee Compare October 14, 2023 17:55
@dhaus67 dhaus67 requested a review from stehessel October 14, 2023 22:37
Copy link
Contributor

@msugakov msugakov left a comment

Choose a reason for hiding this comment

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

Overall looks very good.

I made the first pass, will re-review after you check my comments from this round.

@dhaus67 dhaus67 force-pushed the master-dh/rox-20100-machine-to-machine-api branch 2 times, most recently from c4c3867 to fa3c7b4 Compare October 19, 2023 03:08
@dhaus67
Copy link
Contributor Author

dhaus67 commented Oct 19, 2023

/retest

2 similar comments
@dhaus67
Copy link
Contributor Author

dhaus67 commented Oct 19, 2023

/retest

@dhaus67
Copy link
Contributor Author

dhaus67 commented Oct 19, 2023

/retest

@msugakov
Copy link
Contributor

FYI: force-pushing breaks ability to see only what's changed since my last review. I understand that you have a workflow with Graphite that's convenient for you but it's not convenient to review especially for bigger PRs.

Copy link
Contributor

@md2119 md2119 left a comment

Choose a reason for hiding this comment

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

Do not import storage protos into the api proto.

@dhaus67 dhaus67 force-pushed the master-dh/rox-20100-machine-to-machine-api branch from 82fb93a to d038085 Compare October 25, 2023 20:58
@dhaus67
Copy link
Contributor Author

dhaus67 commented Oct 25, 2023

@dhaus67 What is the name of the predecessor?

There is no predecessor, this is a tech preview feature intended for 4.3.

Copy link
Contributor

@md2119 md2119 left a comment

Choose a reason for hiding this comment

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

Unblocking on author's request.

@openshift-ci
Copy link

openshift-ci bot commented Oct 25, 2023

@dhaus67: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/gke-qa-e2e-tests 82fb93a link false /test gke-qa-e2e-tests
ci/prow/ocp-4-10-sensor-integration-tests d038085 link false /test ocp-4-10-sensor-integration-tests
ci/prow/ocp-4-10-operator-e2e-tests d038085 link false /test ocp-4-10-operator-e2e-tests
ci/prow/ocp-4-10-ebpf-qa-e2e-tests d038085 link false /test ocp-4-10-ebpf-qa-e2e-tests
ci/prow/ocp-4-10-qa-e2e-tests d038085 link false /test ocp-4-10-qa-e2e-tests
ci/prow/ocp-4-13-ebpf-qa-e2e-tests d038085 link false /test ocp-4-13-ebpf-qa-e2e-tests

Full PR test history. Your PR dashboard.

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.

@dhaus67 dhaus67 force-pushed the master-dh/rox-20100-machine-to-machine-api branch from d038085 to b1b0bf2 Compare October 25, 2023 22:30
@dhaus67 dhaus67 enabled auto-merge (squash) October 25, 2023 22:34
@dhaus67 dhaus67 merged commit 1bc3c32 into master Oct 25, 2023
@dhaus67 dhaus67 deleted the master-dh/rox-20100-machine-to-machine-api branch October 25, 2023 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants