Page MenuHomePhabricator

[services][identity] subroutine for generating token and writing it to db
ClosedPublic

Authored by varun on Jun 17 2022, 1:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 14, 4:00 PM
Unknown Object (File)
Mon, Apr 22, 4:55 AM
Unknown Object (File)
Mon, Apr 22, 4:55 AM
Unknown Object (File)
Mon, Apr 22, 4:55 AM
Unknown Object (File)
Mon, Apr 22, 4:55 AM
Unknown Object (File)
Mon, Apr 22, 4:55 AM
Unknown Object (File)
Mon, Apr 22, 4:55 AM
Unknown Object (File)
Mon, Apr 22, 4:55 AM

Details

Summary

we have to do this for both wallet and pake login, so moving it to a helper fn to avoid duplicating code

Depends on D4286

Test Plan

cargo build, further testing done in functions that leverage this helper

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Jun 17 2022, 2:02 PM
jim requested changes to this revision.Jun 17 2022, 2:13 PM
jim added inline comments.
services/identity/src/service.rs
105 ↗(On Diff #13556)

Should this be auth_type instead of AuthType::Password?

This revision now requires changes to proceed.Jun 17 2022, 2:13 PM

fix bug

services/identity/src/service.rs
105 ↗(On Diff #13556)

yes, thank you for catching that

This revision is now accepted and ready to land.Jun 23 2022, 8:08 AM

Whatever was landed wasn't the latest revision of this diff + doesn't build. Going to revert commit on master, this diff will need to be re-opened

error[E0432]: unresolved import `crate::token::AccessToken`
  --> src/service.rs:11:20
   |
11 | use crate::token::{AccessToken, AuthType};
   |                    ^^^^^^^^^^^ no `AccessToken` in `token`
 
error[E0432]: unresolved import `proto::pake_login_response::Data::Token`
  --> src/service.rs:18:46
   |
18 |   login_response::Data::WalletLoginResponse, pake_login_response::Data::Token,
   |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `Token` in `service::proto::pake_login_response::Data`
 
error[E0599]: no method named `put_token` found for struct `DatabaseClient` in the current scope
   --> src/service.rs:106:16
    |
106 |   match client.put_token(token.clone()).await {
    |                ^^^^^^^^^ method not found in `DatabaseClient`
    |
   ::: src/database.rs:16:1
    |
16  | pub struct DatabaseClient {
    | ------------------------- method `put_token` not found for this
 
error[E0560]: struct `WalletLoginResponse` has no field named `token`
   --> src/service.rs:110:11
    |
110 |           token: token.token,
    |           ^^^^^ `WalletLoginResponse` does not have this field
    |
    = note: available fields are: `access_token`
 
Some errors have detailed explanations: E0432, E0560, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `identity` due to 4 previous errors
This revision is now accepted and ready to land.Jun 23 2022, 10:54 AM
This revision was landed with ongoing or failed builds.Jun 23 2022, 11:09 AM
This revision was automatically updated to reflect the committed changes.