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

Add support for Korifi to the cf auth command #2296

Merged
merged 1 commit into from
Aug 18, 2022

Conversation

julian-hj
Copy link
Member

@julian-hj julian-hj commented Jul 15, 2022

Does this PR modify CLI v6, CLI v7, or CLI v8?

v8

Description of the Change

  • Prior to this change, login to Korifi was only possible through cf login. This change adds support for cf auth.
  • cf auth normally requires a password. This change make the password optional when the CF API is Korifi, since we pull credentials from the user's KUBECONFIG in this case.
  • We also check the provided username against the available users from the k8s config to ensure that we will be able to use it.
  • Note that error messages for this command are not localized. My rationale was that other similar errors (like a missing/empty KUBECONFIG) also produce unlocalized errors. Maybe this reasoning is incorrect? If so, we can amend the PR.

I've only made a PR for the v8 branch, based on the instructions in the contributing guidelines. Please let me know if you'd also like a separate PR for main.

Why Is This PR Valuable?

This is useful to us for the same reasons that cf auth is useful in CF on VMs: It's much easier to interact with from automation scripts since it doesn't require us to pipe answers into the CLI from <STDIN>. This will be helpful for us as developers, but likely also for customers that interact with CF through CI pipelines.

Why Should This Be In Core?

The cf login changes are already in core (see #2233), so it would be odd to put cf auth into a plugin. (Also maybe not possible? I am not really sure)

Applicable Issues

Related to #2233 and #2267

How Urgent Is The Change?

Not urgent, just useful.

Other Relevant Parties

CC @tcdowney @emalm @gcapizzi

- `cf auth` normally requires a password. This change make the password
  optional when the CF API is Korifi, since we pull credentials from the
  user's KUBECONFIG in this case.
- We also check the provided username against the available users from
  the k8s config to ensure that we will be able to use it.
- Note that error messages for this command are not localized. My
  rationale was that other similar errors (like a missing/empty
  KUBECONFIG) also produce unlocalized errors. Maybe this reasoning is
  incorrect? If so, we can amend the PR.
Copy link
Contributor

@jdgonzaleza jdgonzaleza left a comment

Choose a reason for hiding this comment

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

LGTM

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.

None yet

4 participants