Chromium Code Reviews| 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 pair. The private -key | |
| 16 // for a certificate is only available for signing operations within the princip al | |
| 17 // service application. | |
| 18 struct Certificate { | |
| 19 string extension; | |
| 20 array<uint8>? publickey; | |
|
ashankar
2015/08/19 05:50:38
Should we mention that this is the DER representat
gautham
2015/08/19 17:45:51
Done.
| |
| 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 // A service that binds user identities to an application instance running in Mo jo | |
| 30 interface PrincipalService { | |
| 31 // Login is called by an application instance (requestor_url/qualifier) that | |
| 32 // wants to get a user blessing. The service may obtain the user blessing | |
| 33 // through a third-party authentication flow (eg:oauth2). The user blessing | |
| 34 // is bound to a public/private key-pair that this service generates and | |
| 35 // persists for this application instance. Returns null if login fails. | |
| 36 Login() => (Blessing? user_blessing); | |
| 37 | |
| 38 // Removes the user blessing for the application instance that invokes the | |
| 39 // Logout method. | |
| 40 Logout(); | |
| 41 | |
| 42 // GetUserBlessing returns the user blessing for a given application instance. | |
| 43 // It returns an error if the application instance has not invoked Login(). | |
| 44 GetUserBlessing(AppInstanceName app) => (Blessing? user_blessing); | |
| 45 }; | |
| 46 | |
| OLD | NEW |