| // Copyright 2016 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.modular; |
| |
| using fuchsia.modular.auth; |
| using fuchsia.ui.gfx; |
| using fuchsia.ui.viewsv1token; |
| using fuchsia.sys; |
| |
| // Given by the |Basemgr| to the |BaseShell| at Initialize() so the |
| // |BaseShell| can get information about the users of this device from the |
| // |Basemgr|, and act on the provided information (including extending the |
| // user database). |
| protocol UserProvider { |
| // Adds information of a user that can be used to authenticate her/him to this |
| // device. Once successfully added, the user can login to the same device via |
| // Login(). |
| // |
| // |identity_provider| is the identity provider to use for identification. |
| // |
| // |device_name| is what the user wants to name the device. If null or empty |
| // the device's current hostname will be used. |
| // |
| // |account| is NULL if there was an error during identification and |
| // |error_code| is set. |
| AddUser(fuchsia.modular.auth.IdentityProvider identity_provider) |
| -> (fuchsia.modular.auth.Account? account, string? error_code); |
| |
| // Removes information of a user from the local user database. |
| // |
| // |account_id| is received from either AddUser() or PreviousUsers(). |
| RemoveUser(string account_id) -> (string? error_code); |
| |
| // Uses the credentials provided in AddUser() to start a user session. This |
| // would mean syncing with the user's ledger instance and displaying a user |
| // shell with all of the user's stories. |
| // TODO(alhaad): In the future, we want to protect Login() with a password, |
| // Android lock pattern, etc. |
| Login(UserLoginParams user_login_params); |
| |
| // List of all users who have authenticated to this device in the past. |
| PreviousUsers() -> (vector<fuchsia.modular.auth.Account> accounts); |
| }; |
| |
| // DEPRECATED, for backwards compatibility only |
| struct UserLoginParams { |
| // |account_id| is received from either AddUser() or PreviousUsers(). It |
| // can be NULL which means logging-in in an incognito mode. |
| string? account_id; |
| |
| // |view_owner| is the view given to the |SessionShell| started for the newly |
| // logged-in user. |
| request<fuchsia.ui.viewsv1token.ViewOwner> view_owner; |
| |
| // Services provided by the |BaseShell| that can be offered to the |
| // |SessionShell| that is being logged into. |
| fuchsia.sys.ServiceProvider? services; |
| }; |
| |
| // Used to specify arguments to log into a user session. |
| struct UserLoginParams2 { |
| // |account_id| is received from either AddUser() or PreviousUsers(). It |
| // can be NULL which means logging-in in an incognito mode. |
| string? account_id; |
| |
| // |view_token| is the view given to the |SessionShell| started for the newly |
| // logged-in user. |
| fuchsia.ui.gfx.ExportToken view_token; |
| |
| // Services provided by the |BaseShell| that can be offered to the |
| // |SessionShell| that is being logged into. |
| fuchsia.sys.ServiceProvider? services; |
| }; |