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

Remove support for disabling the non-PKCE OIDC authentication flow #2713

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

jvanderhoof
Copy link
Contributor

@jvanderhoof jvanderhoof commented Feb 2, 2023

Desired Outcome

Removes backward compatibility for setting State and Nonce values. The functionality removed here was disabled by default for the last release.

Implemented Changes

This PR migrates the functionality encapsulated in the pkce_support_feature namespace to the default v2 namespace.

*Describe how the desired outcome above has been achieved with this PR. In

Connected Issue/Story

N/A

CyberArk internal issue ID: [insert issue ID]

Definition of Done

At least 1 todo must be completed in the sections below for the PR to be
merged.

Changelog

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a
    CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code
    changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR
  • A follow-up issue to update official docs has been filed here: [insert issue ID]
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Disabling the feature flag was never documented, thus, there is no need to update the docs.

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

@jvanderhoof jvanderhoof force-pushed the revert-pkce-flag branch 2 times, most recently from e7a15ef to d6694ca Compare February 2, 2023 20:17
)
}
end
begin
Copy link

Choose a reason for hiding this comment

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

Redundant begin block detected.

bearer_token = oidc_client.access_token!(**access_token_args)
rescue Rack::OAuth2::Client::Error => e
# Only handle the expected errors related to access token retrieval.
case e.message
Copy link

Choose a reason for hiding this comment

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

Authentication::AuthnOidc::V2::Client#callback calls 'e.message' 2 times

raise Errors::Authentication::AuthnOidc::TokenRetrievalFailed,
'Authorization code is invalid'
end
raise e
Copy link

Choose a reason for hiding this comment

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

Authentication::AuthnOidc::V2::Client#callback calls 'raise e' 2 times

}
end
begin
nonce = @random.hex(25)
Copy link

Choose a reason for hiding this comment

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

Authentication::AuthnOidc::V2::Views::ProviderContext#call calls '@random.hex(25)' 2 times

)
}
rescue Errors::Authentication::OAuth::ProviderDiscoveryFailed,
Errors::Authentication::OAuth::ProviderDiscoveryTimeout
Copy link

Choose a reason for hiding this comment

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

Align the elements of an array literal if they span more than one line.

@jvanderhoof jvanderhoof mentioned this pull request Feb 3, 2023
13 tasks
@@ -14,12 +13,18 @@ def initialize(
end

def callback(args)
# TODO: Check that `code` and `state` attributes are present
raise Errors::Authentication::AuthnOidc::StateMismatch unless args[:state] == @authenticator.state
# Note: `code_verifier` param is optional
Copy link

Choose a reason for hiding this comment

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

Annotation keywords like Note should be all upper case, followed by a colon, and a space, then a note describing the problem.

code_verifier = @random.hex(25)
code_challenge = @digest.base64digest(code_verifier).tr("+/", "-_").tr("=", "")
{
service_id: authenticator.service_id,
Copy link

Choose a reason for hiding this comment

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

Authentication::AuthnOidc::V2::Views::ProviderContext#call calls 'authenticator.service_id' 2 times

end

def generate_redirect_url(client:, authenticator:)
def generate_redirect_url(client:, authenticator:, nonce:, code_challenge:)
Copy link

Choose a reason for hiding this comment

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

Authentication::AuthnOidc::V2::Views::ProviderContext#generate_redirect_url has 4 parameters

CHANGELOG.md Outdated
@@ -24,6 +24,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[cyberark/slosilo#31](https://github.com/cyberark/slosilo/pull/31)
[cyberark/conjur#2718](https://github.com/cyberark/conjur/pull/2718)

### Changed
- Removes support for disabling the `CONJUR_FEATURE_PKCE_SUPPORT_ENABLED` flag.
Copy link

Choose a reason for hiding this comment

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

Lists should be surrounded by blank lines

@jvanderhoof jvanderhoof force-pushed the revert-pkce-flag branch 2 times, most recently from a6a9b93 to c3ea3f9 Compare March 20, 2023 22:02
@jvanderhoof jvanderhoof marked this pull request as ready for review March 20, 2023 22:53
@jvanderhoof jvanderhoof requested a review from a team as a code owner March 20, 2023 22:53
Copy link
Contributor

@micahlee micahlee left a comment

Choose a reason for hiding this comment

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

This LGTM! I only have one note on the changelog/version before approving.

@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Nothing should go in this section, please add to the latest unreleased version
(and update the corresponding date), or add a new version.

## [1.19.3] - 2023-01-26
## [1.19.2] - 2023-02-01
Copy link
Contributor

Choose a reason for hiding this comment

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

1.19.2 is already published, so 1.19.3 (or greater) is actually correct. This seems like more than a patch level change. So moving it to 1.20.0 might be appropriate here.

This commit removes the temporary PKCE flag required to safely release the feature in conjunction with the UI changes.
Copy link
Contributor

@micahlee micahlee left a comment

Choose a reason for hiding this comment

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

LGTM!

## [1.19.3] - 2023-03-21

### Changed
- Removes support for disabling the `CONJUR_FEATURE_PKCE_SUPPORT_ENABLED` flag.
Copy link

Choose a reason for hiding this comment

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

Lists should be surrounded by blank lines

@codeclimate
Copy link

codeclimate bot commented Mar 21, 2023

Code Climate has analyzed commit ef89314 and detected 12 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 2
Style 3
Complexity 7

The test coverage on the diff in this pull request is 89.1% (50% is the threshold).

This pull request will bring the total coverage in the repository to 90.2% (-1.3% change).

View more on Code Climate.

@jvanderhoof jvanderhoof merged commit 92bb7a1 into master Mar 21, 2023
@jvanderhoof jvanderhoof deleted the revert-pkce-flag branch March 21, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants