Skip to content

Conversation

@kritikash18
Copy link
Contributor

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@kritikash18 kritikash18 force-pushed the issues/oauth-authentication branch 2 times, most recently from f19ef6b to 97bb566 Compare April 24, 2024 04:21
@codecov
Copy link

codecov bot commented Apr 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.67%. Comparing base (30b3d18) to head (3a401af).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #691   +/-   ##
=======================================
  Coverage   99.67%   99.67%           
=======================================
  Files          64       64           
  Lines        1542     1551    +9     
  Branches      214      218    +4     
=======================================
+ Hits         1537     1546    +9     
  Misses          5        5           

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

@kritikash18 kritikash18 force-pushed the issues/oauth-authentication branch from 97bb566 to 1c71a0d Compare April 24, 2024 04:28
@kritikash18 kritikash18 force-pushed the issues/oauth-authentication branch from 1c71a0d to fa73f5a Compare April 25, 2024 04:11
Copy link
Contributor

@anastasiapintilie anastasiapintilie left a comment

Choose a reason for hiding this comment

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

did you manage to test the changes?


console.log(chalk.dim(' - plugin-cloudmanager list-programs ..'))

// let result
Copy link
Contributor

Choose a reason for hiding this comment

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

is this commented code needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so the way i've seen it work and based on some past pull requests; these tests are disabled when pushing code to PR. If someone needs to test e2e, they need to uncomment all commented part and run e2e. If you see current test, it does nothing until the main code is uncommented

Copy link
Contributor Author

Choose a reason for hiding this comment

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

check PR: #669

}
} else {
const metaScopes = config.meta_scopes
if (!metaScopes.includes || !metaScopes.includes(requiredMetaScopeForJWTIntegration)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to do !metaScopes.includes?

won't metaScopes.includes always be true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I think so. It was already there, so I didn't remove it in case there was a situation which needed this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably, in case someone defines metascopes as some other data type that doesn't support .includes then it would return false

throw new configurationCodes.IMS_CONTEXT_MISSING_METASCOPE({ messageValues: [configKey, requiredMetaScope] })
if (config.oauth_enabled) {
const oauthScopes = config.scopes
if (!oauthScopes.includes || !requiredScopesForOAuthIntegration.every(scope => oauthScopes.includes(scope))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same question: why do we need the check !oauthScopes.includes?

@kritikash18 kritikash18 force-pushed the issues/oauth-authentication branch from fa73f5a to 3a401af Compare April 30, 2024 04:45
@kritikash18 kritikash18 merged commit 0ac4a27 into main May 7, 2024
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.

How to authenticate with aio for Oauth server-to-server credential (without browser authentication) like old/depreicated Service account(JWT) ?

4 participants