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

Organize browser selection classes and change signature for get AuthorizationStrategy, Fixes AB#3119409 #2564

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from

Conversation

p3dr0rv
Copy link
Contributor

@p3dr0rv p3dr0rv commented Jan 3, 2025

The changes here are the preparatory work for the DUNA feature. Splitting this PR from DUNA to simplify the review process.

  • Update Browser Selector and move it to Platform Components
  • Change getAuthorizationStrategy signature from (InteractiveTokenCommandParameters) to (AuthorizationAgent , Browser, isBrokerRequest)
  • Move getBrowserSafeListForBroker from Platform Util to BrowserDescriptor
  • Move Browser to common4j

AB#3119409

@p3dr0rv p3dr0rv changed the title [WIP]draft Organize browser selection classes and change signature for get AuthorizationStrategy Jan 3, 2025
Copy link

github-actions bot commented Jan 3, 2025

✅ Work item link check complete. Description contains link AB#3119409 to an Azure Boards work item.

@AzureAD AzureAD deleted a comment from github-actions bot Jan 3, 2025
@github-actions github-actions bot changed the title Organize browser selection classes and change signature for get AuthorizationStrategy Organize browser selection classes and change signature for get AuthorizationStrategy, Fixes AB#3119409 Jan 3, 2025
@p3dr0rv p3dr0rv marked this pull request as ready for review January 3, 2025 21:19
@p3dr0rv p3dr0rv requested a review from a team as a code owner January 3, 2025 21:19
if (parameters.getAuthorizationAgent() == AuthorizationAgent.WEBVIEW) {
Logger.info(methodTag, "Use webView for authorization.");
// Use embedded webView if no browser available or authorization agent is webView
if (authorizationAgent == AuthorizationAgent.WEBVIEW || browser == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If someone passes authorization agent as BROWSER but passes null browser, then what strategy is picked?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

embedded web view authorization strategy

Add Javadoc:

  • Get the authorization strategy based on the authorization agent and browser.
  • If the authorization agent is WEBVIEW or the browser is null,
  • return the embedded web view authorization strategy.
  • Otherwise, return the browser authorization strategy.

Comment on lines +68 to +69
@NonNull final AuthorizationAgent authorizationAgent,
@Nullable final Browser browser,
Copy link
Contributor

Choose a reason for hiding this comment

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

If someone passes authorization agent as WEBVIEW but also a non-null browser then what does that mean? What strategy gets picked?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

embedded web view authorization strategy

Add Javadoc:
* Get the authorization strategy based on the authorization agent and browser.
* If the authorization agent is WEBVIEW or the browser is null,
* return the embedded web view authorization strategy.
* Otherwise, return the browser authorization strategy.

@p3dr0rv
Copy link
Contributor Author

p3dr0rv commented Jan 8, 2025

@shahzaibj, it seems there is some confusion about the getAuthorizationStrategy method. I’ve rephrased my comment and included it as Javadoc. Does that address the issue, or were you suggesting a different approach?

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.

2 participants