assisted-service icon indicating copy to clipboard operation
assisted-service copied to clipboard

NO-ISSUE: Deprecate and disable support for OCM offline token

Open jhernand opened this issue 9 months ago • 5 comments

Currently or ocm/client package supports authentication to OCM using an offline token via the OCM_SELF_TOKEN environment variable. But the OCM team has deprecated this authentication mechanism and will remove it in the future. The alternative is to use a client identifier and client secret, which is what we use in the SaaS environment. This patch disables by default that support, and will make the server fail with an explicit error message if it is used. Users that really need to use it will need to explicitly enable it setting the ACKNOWLEDGE_DEPRECATED_OCM_SELF_TOKEN environment variable to yes. In that case the server will start, but a warning will be written to the log.

List all the issues related to this PR

  • [X] New Feature
  • [ ] Enhancement
  • [ ] Bug fix
  • [ ] Tests
  • [ ] Documentation
  • [ ] CI/CD

What environments does this code impact?

  • [ ] Automation (CI, tools, etc)
  • [ ] Cloud
  • [ ] Operator Managed Deployments
  • [x] None

How was this code tested?

  • [ ] assisted-test-infra environment
  • [ ] dev-scripts environment
  • [ ] Reviewer's test appreciated
  • [ ] Waiting for CI to do a full test run
  • [X] Manual (Elaborate on how it was tested)
  • [ ] No tests needed

Checklist

  • [X] Title and description added to both, commit and PR.
  • [ ] Relevant issues have been associated (see CONTRIBUTING guide)
  • [ ] This change does not require a documentation update (docstring, docs, README, etc)
  • [ ] Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

jhernand avatar May 11 '24 10:05 jhernand

@jhernand: This pull request explicitly references no jira issue.

In response to this:

Currently or ocm/client package supports authentication to OCM using an offline token via the OCM_SELF_TOKEN environment variable. But the OCM team has deprecated this authentication mechanism and will remove it in the future. The alternative is to use a client identifier and client secret, which is what we use in the SaaS environment. This patch disables by default that support, and will make the server fail with an explicit error message if it is used. Users that really need to use it will need to explicitly enable it setting the ACKNOWLEDGE_DEPRECATED_OCM_SELF_TOKEN environment variable to yes. In that case the server will start, but a warning will be written to the log.

List all the issues related to this PR

  • [X] New Feature
  • [ ] Enhancement
  • [ ] Bug fix
  • [ ] Tests
  • [ ] Documentation
  • [ ] CI/CD

What environments does this code impact?

  • [ ] Automation (CI, tools, etc)
  • [ ] Cloud
  • [ ] Operator Managed Deployments
  • [x] None

How was this code tested?

  • [ ] assisted-test-infra environment
  • [ ] dev-scripts environment
  • [ ] Reviewer's test appreciated
  • [ ] Waiting for CI to do a full test run
  • [X] Manual (Elaborate on how it was tested)
  • [ ] No tests needed

Checklist

  • [X] Title and description added to both, commit and PR.
  • [ ] Relevant issues have been associated (see CONTRIBUTING guide)
  • [ ] This change does not require a documentation update (docstring, docs, README, etc)
  • [ ] Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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 openshift-eng/jira-lifecycle-plugin repository.

openshift-ci-robot avatar May 11 '24 10:05 openshift-ci-robot

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhernand

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar May 11 '24 10:05 openshift-ci[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.98%. Comparing base (904ee71) to head (0dcfead). Report is 17 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6307      +/-   ##
==========================================
+ Coverage   68.29%   68.98%   +0.69%     
==========================================
  Files         241      245       +4     
  Lines       35863    39450    +3587     
==========================================
+ Hits        24491    27213    +2722     
- Misses       9212     9813     +601     
- Partials     2160     2424     +264     

see 20 files with indirect coverage changes

codecov[bot] avatar May 11 '24 10:05 codecov[bot]

/retest

rccrdpccl avatar May 14 '24 08:05 rccrdpccl

/test edge-e2e-metal-assisted

gamli75 avatar May 23 '24 06:05 gamli75

/lgtm

eifrach avatar May 27 '24 07:05 eifrach

/retest-required

Remaining retests: 0 against base HEAD 4f4c46493887bed73e88b5661f4f2a503d5ccf35 and 2 for PR HEAD 0dcfeadb741e383f6463eb92d10f54e05d769ce7 in total

openshift-ci-robot avatar May 27 '24 08:05 openshift-ci-robot

/retest

rccrdpccl avatar May 27 '24 09:05 rccrdpccl

/retest-required

Remaining retests: 0 against base HEAD 8a63485495f366dbdf45b33c31fd0994e0c0986a and 1 for PR HEAD 0dcfeadb741e383f6463eb92d10f54e05d769ce7 in total

openshift-ci-robot avatar May 27 '24 11:05 openshift-ci-robot

@jhernand: all tests passed!

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

openshift-ci[bot] avatar May 27 '24 18:05 openshift-ci[bot]

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-agent-installer-api-server-container-v4.17.0-202405272012.p0.g5b71872.assembly.stream.el9 for distgit ose-agent-installer-api-server. All builds following this will include this PR.

openshift-bot avatar May 27 '24 21:05 openshift-bot