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

Add API LoginWizard.loginCustom(data: JsonDict): Session #4346

Merged
merged 1 commit into from
Oct 26, 2021

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Oct 26, 2021

To be able to login to a homeserver using arbitrary request content

Fixes #4266

… to login to a homeserver using arbitrary request content
@@ -121,6 +121,10 @@ internal interface AuthAPI {
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "login")
suspend fun login(@Body loginParams: TokenLoginParams): Credentials

@Headers("CONNECT_TIMEOUT:60000", "READ_TIMEOUT:60000", "WRITE_TIMEOUT:60000")
Copy link
Contributor

@ouchadam ouchadam Oct 26, 2021

Choose a reason for hiding this comment

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

are these timeouts different to the http client connection timeouts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I think so, here I've just copy pasted what was above without really thinking about it.

* Login to the homeserver by sending a custom JsonDict.
* The data should contain at least one entry "type" with a String value.
*/
suspend fun loginCustom(data: JsonDict): Session
Copy link
Contributor

Choose a reason for hiding this comment

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

should we enforce the type as a separate parameter and apply it to the jsonDict, or is the documentation enough?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've thought about it, happy to see that you have the same thoughts, but here it will be up to the caller to do what's necessary for this API to work, and I did not want to close doors.

Copy link
Contributor

@ouchadam ouchadam left a comment

Choose a reason for hiding this comment

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

some questions but no blockers from me! 💯

@github-actions
Copy link

Unit Test Results

  48 files  ±0    48 suites  ±0   49s ⏱️ -4s
  91 tests ±0    91 ✔️ ±0  0 💤 ±0  0 ±0 
244 runs  ±0  244 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit e8ccae8. ± Comparison against base commit 01a29f6.

@bmarty bmarty merged commit 31abf44 into develop Oct 26, 2021
@bmarty bmarty deleted the feature/bma/login_custom branch October 26, 2021 17:28
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.

[SDK] SDK V2, no API for login with login type parameter - Cannot login.
2 participants