2021-05-10 20:56:20 +02:00
|
|
|
<!doctype html>
|
|
|
|
<html class="no-js" lang="">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
|
|
<title>CICADA</title>
|
|
|
|
<meta name="description" content="">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
|
|
|
|
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
2021-09-03 01:48:41 +02:00
|
|
|
<link rel="stylesheet" href="../styles/style.css">
|
|
|
|
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)">
|
2021-05-10 20:56:20 +02:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div class="navbar navbar-default navbar-fixed-top visible-xs">
|
|
|
|
<a href="../" class="navbar-brand">CICADA</a>
|
|
|
|
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="xs-menu menu" id="mobile-menu">
|
|
|
|
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="container-fluid main">
|
|
|
|
<div class="row main">
|
|
|
|
<div class="hidden-xs menu">
|
|
|
|
<compodoc-menu mode="normal"></compodoc-menu>
|
|
|
|
</div>
|
|
|
|
<!-- START CONTENT -->
|
|
|
|
<div class="content injectable">
|
|
|
|
<div class="content-data">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li>Injectables</li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<li >AuthService</li>
|
2021-05-10 20:56:20 +02:00
|
|
|
</ol>
|
|
|
|
|
|
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
|
|
<li class="active">
|
|
|
|
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
|
|
|
|
</li>
|
|
|
|
<li >
|
|
|
|
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-pane fade active in" id="c-info">
|
|
|
|
<p class="comment">
|
|
|
|
<h3>File</h3>
|
|
|
|
</p>
|
|
|
|
<p class="comment">
|
|
|
|
<code>src/app/_services/auth.service.ts</code>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-03 01:48:41 +02:00
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
<section>
|
|
|
|
<h3 id="index">Index</h3>
|
|
|
|
<table class="table table-sm table-bordered index-table">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<h6><b>Properties</b></h6>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<ul class="index-list">
|
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#mutableKeyStore" >mutableKeyStore</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#trustedUsers" >trustedUsers</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
2021-06-14 13:28:53 +02:00
|
|
|
<span class="modifier">Private</span>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#trustedUsersList" >trustedUsersList</a>
|
2021-06-14 13:28:53 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#trustedUsersSubject" >trustedUsersSubject</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<h6><b>Methods</b></h6>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<ul class="index-list">
|
2021-06-14 13:28:53 +02:00
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#addTrustedUser" >addTrustedUser</a>
|
2021-06-14 13:28:53 +02:00
|
|
|
</li>
|
2021-05-10 20:56:20 +02:00
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#getChallenge" >getChallenge</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#getPrivateKey" >getPrivateKey</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
2021-06-14 13:28:53 +02:00
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#getPrivateKeyInfo" >getPrivateKeyInfo</a>
|
2021-06-14 13:28:53 +02:00
|
|
|
</li>
|
2021-05-10 20:56:20 +02:00
|
|
|
<li>
|
|
|
|
<span class="modifier">Async</span>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#getPublicKeys" >getPublicKeys</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
2021-06-14 13:28:53 +02:00
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#getSessionToken" >getSessionToken</a>
|
2021-06-14 13:28:53 +02:00
|
|
|
</li>
|
2021-05-10 20:56:20 +02:00
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#getTrustedUsers" >getTrustedUsers</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#getWithToken" >getWithToken</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<span class="modifier">Async</span>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#init" >init</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<span class="modifier">Async</span>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#login" >login</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#loginView" >loginView</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#logout" >logout</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#sendSignedChallenge" >sendSignedChallenge</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<span class="modifier">Async</span>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#setKey" >setKey</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
2021-06-14 13:28:53 +02:00
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#setSessionToken" >setSessionToken</a>
|
2021-06-14 13:28:53 +02:00
|
|
|
</li>
|
2021-05-10 20:56:20 +02:00
|
|
|
<li>
|
2021-09-03 01:48:41 +02:00
|
|
|
<a href="#setState" >setState</a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<h3 id="constructor">Constructor</h3>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<code>constructor(loggingService: <a href="../injectables/LoggingService.html" target="_self">LoggingService</a>, errorDialogService: <a href="../injectables/ErrorDialogService.html" target="_self">ErrorDialogService</a>)</code>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="22" class="link-to-prism">src/app/_services/auth.service.ts:22</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<div>
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>loggingService</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
<code><a href="../injectables/LoggingService.html" target="_self" >LoggingService</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>errorDialogService</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
<code><a href="../injectables/ErrorDialogService.html" target="_self" >ErrorDialogService</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
|
|
|
|
<h3 id="methods">
|
|
|
|
Methods
|
|
|
|
</h3>
|
2021-06-14 13:28:53 +02:00
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="addTrustedUser"></a>
|
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>addTrustedUser</b></span>
|
2021-06-14 13:28:53 +02:00
|
|
|
<a href="#addTrustedUser"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<code>addTrustedUser(user: <a href="../interfaces/Staff.html" target="_self">Staff</a>)</code>
|
2021-06-14 13:28:53 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="170"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:170</a></div>
|
2021-06-14 13:28:53 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>user</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="../interfaces/Staff.html" target="_self" >Staff</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2021-05-10 20:56:20 +02:00
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getChallenge"></a>
|
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>getChallenge</b></span>
|
2021-05-10 20:56:20 +02:00
|
|
|
<a href="#getChallenge"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getChallenge()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="83"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:83</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
2021-06-14 13:28:53 +02:00
|
|
|
<b>Returns : </b> <code>Promise<any></code>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getPrivateKey"></a>
|
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>getPrivateKey</b></span>
|
2021-05-10 20:56:20 +02:00
|
|
|
<a href="#getPrivateKey"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getPrivateKey()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="200"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:200</a></div>
|
2021-06-14 13:28:53 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getPrivateKeyInfo"></a>
|
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>getPrivateKeyInfo</b></span>
|
2021-06-14 13:28:53 +02:00
|
|
|
<a href="#getPrivateKeyInfo"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getPrivateKeyInfo()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="204"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:204</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getPublicKeys"></a>
|
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span class="modifier">Async</span>
|
|
|
|
<span ><b>getPublicKeys</b></span>
|
2021-05-10 20:56:20 +02:00
|
|
|
<a href="#getPublicKeys"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
|
|
<code>getPublicKeys()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="188"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:188</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Promise<any></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-06-14 13:28:53 +02:00
|
|
|
<a name="getSessionToken"></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>getSessionToken</b></span>
|
2021-06-14 13:28:53 +02:00
|
|
|
<a href="#getSessionToken"><span class="icon ion-ios-link"></span></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-06-14 13:28:53 +02:00
|
|
|
<code>getSessionToken()</code>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="36"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:36</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
2021-06-14 13:28:53 +02:00
|
|
|
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-06-14 13:28:53 +02:00
|
|
|
<a name="getTrustedUsers"></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>getTrustedUsers</b></span>
|
2021-06-14 13:28:53 +02:00
|
|
|
<a href="#getTrustedUsers"><span class="icon ion-ios-link"></span></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-06-14 13:28:53 +02:00
|
|
|
<code>getTrustedUsers()</code>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="182"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:182</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-06-14 13:28:53 +02:00
|
|
|
<a name="getWithToken"></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>getWithToken</b></span>
|
2021-06-14 13:28:53 +02:00
|
|
|
<a href="#getWithToken"><span class="icon ion-ios-link"></span></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-06-14 13:28:53 +02:00
|
|
|
<code>getWithToken()</code>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="48"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:48</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
2021-06-14 13:28:53 +02:00
|
|
|
<b>Returns : </b> <code>Promise<boolean></code>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-06-14 13:28:53 +02:00
|
|
|
<a name="init"></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span class="modifier">Async</span>
|
|
|
|
<span ><b>init</b></span>
|
2021-06-14 13:28:53 +02:00
|
|
|
<a href="#init"><span class="icon ion-ios-link"></span></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-06-14 13:28:53 +02:00
|
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
|
|
<code>init()</code>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="29"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:29</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
2021-06-14 13:28:53 +02:00
|
|
|
<b>Returns : </b> <code>Promise<void></code>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-06-14 13:28:53 +02:00
|
|
|
<a name="login"></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span class="modifier">Async</span>
|
|
|
|
<span ><b>login</b></span>
|
2021-06-14 13:28:53 +02:00
|
|
|
<a href="#login"><span class="icon ion-ios-link"></span></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
2021-06-14 13:28:53 +02:00
|
|
|
<code>login()</code>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="92"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:92</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
2021-06-14 13:28:53 +02:00
|
|
|
<b>Returns : </b> <code>Promise<boolean></code>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="loginView"></a>
|
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>loginView</b></span>
|
2021-05-10 20:56:20 +02:00
|
|
|
<a href="#loginView"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>loginView()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="126"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:126</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="logout"></a>
|
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>logout</b></span>
|
2021-05-10 20:56:20 +02:00
|
|
|
<a href="#logout"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>logout()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="164"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:164</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-06-14 13:28:53 +02:00
|
|
|
<a name="sendSignedChallenge"></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>sendSignedChallenge</b></span>
|
2021-06-14 13:28:53 +02:00
|
|
|
<a href="#sendSignedChallenge"><span class="icon ion-ios-link"></span></a>
|
2021-05-10 20:56:20 +02:00
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-06-14 13:28:53 +02:00
|
|
|
<code>sendSignedChallenge(hobaResponseEncoded: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="71"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:71</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>hobaResponseEncoded</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-06-14 13:28:53 +02:00
|
|
|
<b>Returns : </b> <code>Promise<any></code>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="setKey"></a>
|
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span class="modifier">Async</span>
|
|
|
|
<span ><b>setKey</b></span>
|
2021-05-10 20:56:20 +02:00
|
|
|
<a href="#setKey"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
|
|
<code>setKey(privateKeyArmored)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="136"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:136</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 08:16:38 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>privateKeyArmored</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 08:16:38 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>Private key.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Promise<boolean></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2021-06-14 13:28:53 +02:00
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="setSessionToken"></a>
|
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>setSessionToken</b></span>
|
2021-06-14 13:28:53 +02:00
|
|
|
<a href="#setSessionToken"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>setSessionToken(token)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="40"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:40</a></div>
|
2021-06-14 13:28:53 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Optional</td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>token</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2021-05-10 20:56:20 +02:00
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="setState"></a>
|
|
|
|
<span class="name">
|
2021-09-03 01:48:41 +02:00
|
|
|
<span ><b>setState</b></span>
|
2021-05-10 20:56:20 +02:00
|
|
|
<a href="#setState"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>setState(s)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="44"
|
|
|
|
class="link-to-prism">src/app/_services/auth.service.ts:44</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Optional</td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>s</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
|
2021-09-03 01:48:41 +02:00
|
|
|
<h3 id="inputs">
|
|
|
|
Properties
|
|
|
|
</h3>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="mutableKeyStore"></a>
|
|
|
|
<span class="name">
|
|
|
|
<span ><b>mutableKeyStore</b></span>
|
|
|
|
<a href="#mutableKeyStore"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2021-05-10 20:56:20 +02:00
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<i>Type : </i> <code><a href="../interfaces/MutableKeyStore.html" target="_self" >MutableKeyStore</a></code>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="17" class="link-to-prism">src/app/_services/auth.service.ts:17</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
2021-09-03 01:48:41 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="trustedUsers"></a>
|
|
|
|
<span class="name">
|
|
|
|
<span ><b>trustedUsers</b></span>
|
|
|
|
<a href="#trustedUsers"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2021-05-10 20:56:20 +02:00
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<i>Type : </i> <code><a href="../interfaces/Staff.html" target="_self" >Array<Staff></a></code>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<i>Default value : </i><code>[]</code>
|
2021-06-14 13:28:53 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="18" class="link-to-prism">src/app/_services/auth.service.ts:18</a></div>
|
2021-06-14 13:28:53 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
2021-09-03 01:48:41 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="trustedUsersList"></a>
|
|
|
|
<span class="name">
|
|
|
|
<span class="modifier">Private</span>
|
|
|
|
<span ><b>trustedUsersList</b></span>
|
|
|
|
<a href="#trustedUsersList"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2021-06-14 13:28:53 +02:00
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<i>Type : </i> <code><a href="../interfaces/Staff.html" target="_self" >BehaviorSubject<Array<Staff>></a></code>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
2021-09-03 01:48:41 +02:00
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<i>Default value : </i><code>new BehaviorSubject<Array<Staff>>(
|
2021-06-14 13:28:53 +02:00
|
|
|
this.trustedUsers
|
|
|
|
)</code>
|
2021-09-03 01:48:41 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-line">Defined in <a href="" data-line="19" class="link-to-prism">src/app/_services/auth.service.ts:19</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
2021-09-03 01:48:41 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="trustedUsersSubject"></a>
|
|
|
|
<span class="name">
|
|
|
|
<span ><b>trustedUsersSubject</b></span>
|
|
|
|
<a href="#trustedUsersSubject"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2021-05-10 20:56:20 +02:00
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<i>Type : </i> <code><a href="../interfaces/Staff.html" target="_self" >Observable<Array<Staff>></a></code>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<i>Default value : </i><code>this.trustedUsersList.asObservable()</code>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-09-03 01:48:41 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="22" class="link-to-prism">src/app/_services/auth.service.ts:22</a></div>
|
2021-06-14 13:28:53 +02:00
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
2021-09-03 01:48:41 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2021-05-10 20:56:20 +02:00
|
|
|
</section>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="tab-pane fade tab-source-code" id="c-source">
|
2021-05-11 19:51:48 +02:00
|
|
|
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from '@angular/core';
|
|
|
|
import { hobaParseChallengeHeader } from '@src/assets/js/hoba.js';
|
|
|
|
import { signChallenge } from '@src/assets/js/hoba-pgp.js';
|
|
|
|
import { environment } from '@src/environments/environment';
|
|
|
|
import { LoggingService } from '@app/_services/logging.service';
|
2021-06-15 18:49:26 +02:00
|
|
|
import { MutableKeyStore } from '@app/_pgp';
|
2021-05-11 19:51:48 +02:00
|
|
|
import { ErrorDialogService } from '@app/_services/error-dialog.service';
|
2021-06-14 13:28:53 +02:00
|
|
|
import { HttpError, rejectBody } from '@app/_helpers/global-error-handler';
|
|
|
|
import { Staff } from '@app/_models';
|
|
|
|
import { BehaviorSubject, Observable } from 'rxjs';
|
2021-06-15 18:49:26 +02:00
|
|
|
import { KeystoreService } from '@app/_services/keystore.service';
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
@Injectable({
|
2021-05-11 19:51:48 +02:00
|
|
|
providedIn: 'root',
|
2021-05-10 20:56:20 +02:00
|
|
|
})
|
|
|
|
export class AuthService {
|
|
|
|
mutableKeyStore: MutableKeyStore;
|
2021-06-14 13:28:53 +02:00
|
|
|
trustedUsers: Array<Staff> = [];
|
|
|
|
private trustedUsersList: BehaviorSubject<Array<Staff>> = new BehaviorSubject<Array<Staff>>(
|
|
|
|
this.trustedUsers
|
|
|
|
);
|
|
|
|
trustedUsersSubject: Observable<Array<Staff>> = this.trustedUsersList.asObservable();
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
constructor(
|
|
|
|
private loggingService: LoggingService,
|
|
|
|
private errorDialogService: ErrorDialogService
|
2021-06-15 18:49:26 +02:00
|
|
|
) {}
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
async init(): Promise<void> {
|
2021-06-15 18:49:26 +02:00
|
|
|
this.mutableKeyStore = await KeystoreService.getKeystore();
|
2021-05-10 20:56:20 +02:00
|
|
|
if (localStorage.getItem(btoa('CICADA_PRIVATE_KEY'))) {
|
|
|
|
await this.mutableKeyStore.importPrivateKey(localStorage.getItem(btoa('CICADA_PRIVATE_KEY')));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-14 13:28:53 +02:00
|
|
|
getSessionToken(): string {
|
|
|
|
return sessionStorage.getItem(btoa('CICADA_SESSION_TOKEN'));
|
|
|
|
}
|
|
|
|
|
|
|
|
setSessionToken(token): void {
|
|
|
|
sessionStorage.setItem(btoa('CICADA_SESSION_TOKEN'), token);
|
|
|
|
}
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
setState(s): void {
|
|
|
|
document.getElementById('state').innerHTML = s;
|
|
|
|
}
|
|
|
|
|
2021-06-14 13:28:53 +02:00
|
|
|
getWithToken(): Promise<boolean> {
|
2021-09-03 01:48:41 +02:00
|
|
|
const sessionToken = this.getSessionToken();
|
2021-06-14 13:28:53 +02:00
|
|
|
const headers = {
|
2021-09-03 01:48:41 +02:00
|
|
|
Authorization: 'Bearer ' + sessionToken,
|
2021-06-14 13:28:53 +02:00
|
|
|
'Content-Type': 'application/json;charset=utf-8',
|
|
|
|
'x-cic-automerge': 'none',
|
|
|
|
};
|
|
|
|
const options = {
|
|
|
|
headers,
|
|
|
|
};
|
|
|
|
return fetch(environment.cicMetaUrl, options).then((response) => {
|
|
|
|
if (!response.ok) {
|
|
|
|
this.loggingService.sendErrorLevelMessage('failed to get with auth token.', this, {
|
|
|
|
error: '',
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
2021-06-14 13:28:53 +02:00
|
|
|
return true;
|
2021-05-10 20:56:20 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO rename to send signed challenge and set session. Also separate these responsibilities
|
2021-06-14 13:28:53 +02:00
|
|
|
sendSignedChallenge(hobaResponseEncoded: any): Promise<any> {
|
|
|
|
const headers = {
|
|
|
|
Authorization: 'HOBA ' + hobaResponseEncoded,
|
|
|
|
'Content-Type': 'application/json;charset=utf-8',
|
|
|
|
'x-cic-automerge': 'none',
|
|
|
|
};
|
|
|
|
const options = {
|
|
|
|
headers,
|
|
|
|
};
|
|
|
|
return fetch(environment.cicMetaUrl, options);
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-06-14 13:28:53 +02:00
|
|
|
getChallenge(): Promise<any> {
|
|
|
|
return fetch(environment.cicMetaUrl).then((response) => {
|
|
|
|
if (response.status === 401) {
|
|
|
|
const authHeader: string = response.headers.get('WWW-Authenticate');
|
|
|
|
return hobaParseChallengeHeader(authHeader);
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
2021-06-14 13:28:53 +02:00
|
|
|
});
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-06-14 13:28:53 +02:00
|
|
|
async login(): Promise<boolean> {
|
|
|
|
if (this.getSessionToken()) {
|
|
|
|
sessionStorage.removeItem(btoa('CICADA_SESSION_TOKEN'));
|
2021-09-03 01:48:41 +02:00
|
|
|
}
|
|
|
|
const o = await this.getChallenge();
|
|
|
|
|
|
|
|
const r = await signChallenge(
|
|
|
|
o.challenge,
|
|
|
|
o.realm,
|
|
|
|
environment.cicMetaUrl,
|
|
|
|
this.mutableKeyStore
|
|
|
|
);
|
|
|
|
|
|
|
|
const tokenResponse = await this.sendSignedChallenge(r).then((response) => {
|
|
|
|
const token = response.headers.get('Token');
|
|
|
|
if (token) {
|
|
|
|
return token;
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
2021-09-03 01:48:41 +02:00
|
|
|
if (response.status === 401) {
|
|
|
|
throw new HttpError('You are not authorized to use this system', response.status);
|
|
|
|
}
|
|
|
|
if (!response.ok) {
|
|
|
|
throw new HttpError('Unknown error from authentication server', response.status);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
if (tokenResponse) {
|
|
|
|
this.setSessionToken(tokenResponse);
|
|
|
|
// this.setState('Click button to log in');
|
|
|
|
return true;
|
2021-06-14 13:28:53 +02:00
|
|
|
}
|
2021-09-03 01:48:41 +02:00
|
|
|
return false;
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
loginView(): void {
|
|
|
|
document.getElementById('one').style.display = 'none';
|
|
|
|
document.getElementById('two').style.display = 'block';
|
|
|
|
this.setState('Click button to log in with PGP key ' + this.mutableKeyStore.getPrivateKeyId());
|
|
|
|
}
|
|
|
|
|
2021-05-12 08:16:38 +02:00
|
|
|
/**
|
|
|
|
* @throws
|
|
|
|
* @param privateKeyArmored - Private key.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
async setKey(privateKeyArmored): Promise<boolean> {
|
|
|
|
try {
|
|
|
|
const isValidKeyCheck = await this.mutableKeyStore.isValidKey(privateKeyArmored);
|
|
|
|
if (!isValidKeyCheck) {
|
|
|
|
throw Error('The private key is invalid');
|
|
|
|
}
|
|
|
|
// TODO leaving this out for now.
|
|
|
|
// const isEncryptedKeyCheck = await this.mutableKeyStore.isEncryptedPrivateKey(privateKeyArmored);
|
|
|
|
// if (!isEncryptedKeyCheck) {
|
|
|
|
// throw Error('The private key doesn\'t have a password!');
|
|
|
|
// }
|
|
|
|
const key = await this.mutableKeyStore.importPrivateKey(privateKeyArmored);
|
|
|
|
localStorage.setItem(btoa('CICADA_PRIVATE_KEY'), privateKeyArmored);
|
|
|
|
} catch (err) {
|
2021-05-11 19:51:48 +02:00
|
|
|
this.loggingService.sendErrorLevelMessage(
|
|
|
|
`Failed to set key: ${err.message || err.statusText}`,
|
|
|
|
this,
|
|
|
|
{ error: err }
|
|
|
|
);
|
2021-05-10 20:56:20 +02:00
|
|
|
this.errorDialogService.openDialog({
|
|
|
|
message: `Failed to set key: ${err.message || err.statusText}`,
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
this.loginView();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
logout(): void {
|
|
|
|
sessionStorage.removeItem(btoa('CICADA_SESSION_TOKEN'));
|
2021-06-14 13:28:53 +02:00
|
|
|
localStorage.removeItem(btoa('CICADA_PRIVATE_KEY'));
|
2021-05-11 19:51:48 +02:00
|
|
|
window.location.reload();
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-06-14 13:28:53 +02:00
|
|
|
addTrustedUser(user: Staff): void {
|
|
|
|
const savedIndex = this.trustedUsers.findIndex((staff) => staff.userid === user.userid);
|
|
|
|
if (savedIndex === 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (savedIndex > 0) {
|
|
|
|
this.trustedUsers.splice(savedIndex, 1);
|
|
|
|
}
|
|
|
|
this.trustedUsers.unshift(user);
|
|
|
|
this.trustedUsersList.next(this.trustedUsers);
|
|
|
|
}
|
|
|
|
|
|
|
|
getTrustedUsers(): void {
|
|
|
|
this.mutableKeyStore.getPublicKeys().forEach((key) => {
|
|
|
|
this.addTrustedUser(key.users[0].userId);
|
|
|
|
});
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
async getPublicKeys(): Promise<any> {
|
2021-06-14 13:28:53 +02:00
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
fetch(environment.publicKeysUrl).then((res) => {
|
|
|
|
if (!res.ok) {
|
|
|
|
// TODO does angular recommend an error interface?
|
|
|
|
return reject(rejectBody(res));
|
|
|
|
}
|
|
|
|
return resolve(res.text());
|
|
|
|
});
|
2021-05-11 19:51:48 +02:00
|
|
|
});
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
getPrivateKey(): any {
|
2021-05-11 19:51:48 +02:00
|
|
|
return this.mutableKeyStore.getPrivateKey();
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
2021-06-14 13:28:53 +02:00
|
|
|
|
|
|
|
getPrivateKeyInfo(): any {
|
|
|
|
return this.getPrivateKey().users[0].userId;
|
|
|
|
}
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
</code></pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div class="search-results">
|
|
|
|
<div class="has-results">
|
|
|
|
<h1 class="search-results-title"><span class='search-results-count'></span> result-matching "<span class='search-query'></span>"</h1>
|
|
|
|
<ul class="search-results-list"></ul>
|
|
|
|
</div>
|
|
|
|
<div class="no-results">
|
|
|
|
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- END CONTENT -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
|
|
|
var COMPODOC_CURRENT_PAGE_CONTEXT = 'injectable';
|
|
|
|
var COMPODOC_CURRENT_PAGE_URL = 'AuthService.html';
|
|
|
|
var MAX_SEARCH_RESULTS = 15;
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script src="../js/libs/custom-elements.min.js"></script>
|
|
|
|
<script src="../js/libs/lit-html.js"></script>
|
2021-09-03 01:48:41 +02:00
|
|
|
|
|
|
|
<script type="module" src="../js/menu-wc.js" defer></script>
|
|
|
|
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<script src="../js/libs/bootstrap-native.js"></script>
|
|
|
|
|
|
|
|
<script src="../js/libs/es6-shim.min.js"></script>
|
|
|
|
<script src="../js/libs/EventDispatcher.js"></script>
|
|
|
|
<script src="../js/libs/promise.min.js"></script>
|
|
|
|
<script src="../js/libs/zepto.min.js"></script>
|
|
|
|
|
|
|
|
<script src="../js/compodoc.js"></script>
|
|
|
|
|
|
|
|
<script src="../js/tabs.js"></script>
|
|
|
|
<script src="../js/menu.js"></script>
|
|
|
|
<script src="../js/libs/clipboard.min.js"></script>
|
|
|
|
<script src="../js/libs/prism.js"></script>
|
|
|
|
<script src="../js/sourceCode.js"></script>
|
|
|
|
<script src="../js/search/search.js"></script>
|
|
|
|
<script src="../js/search/lunr.min.js"></script>
|
|
|
|
<script src="../js/search/search-lunr.js"></script>
|
|
|
|
<script src="../js/search/search_index.js"></script>
|
|
|
|
<script src="../js/lazy-load-graphs.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|