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

SDKS-2782 cookiename/AM URL/Realm are mandatory field #361

Merged
merged 2 commits into from
Dec 4, 2023
Merged

Conversation

jeyanthanperiyasamy
Copy link
Contributor

@jeyanthanperiyasamy jeyanthanperiyasamy commented Nov 24, 2023

JIRA Ticket

Please link jira ticket here

Description

1.The idea is to keep by default the cookiename and realm has value if the user didnt add this
cookiename = iplanetdirectorypro
realm = root

  1. validate the AMURL, cookiename, realm is not blank or empty

@jeyanthanperiyasamy jeyanthanperiyasamy changed the title Sdks 2782 SDKS-2782 cookie name mandatory field Nov 27, 2023
@jeyanthanperiyasamy jeyanthanperiyasamy changed the title SDKS-2782 cookie name mandatory field SDKS-2782 cookiename/AM URL/Realm are mandatory field Nov 27, 2023
url = sharedPreferences.getString(ConfigHelper.url, null) ?: ""
realm = sharedPreferences.getString(ConfigHelper.realm, null) ?: ""
cookieName = sharedPreferences.getString(ConfigHelper.cookieName, null) ?: ""
url = sharedPreferences.getString(ConfigHelper.url, null) ?: context.getString(R.string.forgerock_url)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the defValue sharedPreferences.getString(value, defValue) for the null case.
sharePreferences.getString(ConfigHelper.url, context.getString(R.string.forgerock_url)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no change required. already discussed

witrisna
witrisna previously approved these changes Nov 28, 2023
@@ -47,6 +47,8 @@ public static synchronized void start(Context context, @Nullable FROptions optio
if(!started || !FROptions.equals(cachedOptions, options)) {
started = true;
FROptions currentOptions = ConfigHelper.load(context, options);
//Validate (AM URL, Realm, CookieName) is not Empty. If its empty will throw IllegalArgumentException.
currentOptions.validateConfig();
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we throwing the new exception here?

Copy link
Contributor Author

@jeyanthanperiyasamy jeyanthanperiyasamy Nov 29, 2023

Choose a reason for hiding this comment

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

yes , we are throwing a new exception, its intentional when the user supplies empty url, realm, cookiename . we dont usually declare the Runtime exception

spetrov
spetrov previously approved these changes Nov 29, 2023
Copy link
Contributor

@spetrov spetrov left a comment

Choose a reason for hiding this comment

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

Please, put a note in CHANGELOG.md about this change.
Other than that the changes look good to me!

rodrigoareis
rodrigoareis previously approved these changes Nov 29, 2023
Copy link
Contributor

@rodrigoareis rodrigoareis left a comment

Choose a reason for hiding this comment

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

Changes looks good to me

spetrov
spetrov previously approved these changes Dec 4, 2023
Copy link
Contributor

@spetrov spetrov left a comment

Choose a reason for hiding this comment

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

LGTM! 👍🏻

@spetrov spetrov dismissed stale reviews from rodrigoareis and themself via d81dd52 December 4, 2023 22:46
@spetrov spetrov merged commit 13d2a3d into develop Dec 4, 2023
2 of 3 checks passed
@spetrov spetrov deleted the SDKS-2782 branch December 4, 2023 22:47
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.

4 participants