OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 module vanadium; | |
6 | |
7 // Represents the name of an application. |url| is the url of the | |
8 // application. |qualifier| is a string that allows to tie a specific | |
9 // instance of an application to another. | |
10 struct AppInstanceName { | |
11 string url; | |
12 string? qualifier; | |
13 }; | |
14 | |
15 // Certificate represents a human-readable name and public-key (DER encoded) pai
r. | |
16 // The private-key for a certificate is only available for signing operations | |
17 // within the principal service application. | |
18 struct Certificate { | |
19 string extension; | |
20 array<uint8>? publickey; | |
21 }; | |
22 | |
23 // Blessing is a credential binding a user identity to a public key. The corresp
onding | |
24 // private key is only available for signing within the PrincipalService applica
tion. | |
25 struct Blessing { | |
26 array<Certificate> chain; | |
27 }; | |
28 | |
29 // ChainSeparator is the separator used to join name extensions in a certificate
chain. | |
30 const string ChainSeparator = "/"; | |
31 | |
32 // A service that binds user identities to an application instance running in Mo
jo | |
33 interface PrincipalService { | |
34 // Login is called by an application instance (requestor_url/qualifier) that | |
35 // wants to get a user blessing. The service may obtain the user blessing | |
36 // through a third-party authentication flow (eg:oauth2). The user blessing | |
37 // is bound to a public/private key-pair that this service generates and | |
38 // persists for this application instance. Returns null if login fails. | |
39 Login() => (Blessing? user_blessing); | |
40 | |
41 // Removes the user blessing for the application instance that invokes the | |
42 // Logout method. | |
43 Logout(); | |
44 | |
45 // GetUserBlessing returns the user blessing for a given application instance. | |
46 // It returns an error if the application instance has not invoked Login(). | |
47 GetUserBlessing(AppInstanceName app) => (Blessing? user_blessing); | |
48 }; | |
49 | |
OLD | NEW |