Skip to content

Commit

Permalink
feat: refactor auth from cache client
Browse files Browse the repository at this point in the history
  • Loading branch information
JGiter committed Mar 31, 2023
1 parent 278f4a6 commit 194a95d
Show file tree
Hide file tree
Showing 15 changed files with 337 additions and 348 deletions.
36 changes: 0 additions & 36 deletions docs/api/classes/modules_cache_client.CacheClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@

- [constructor](modules_cache_client.CacheClient.md#constructor)

### Properties

- [pubKeyAndIdentityToken](modules_cache_client.CacheClient.md#pubkeyandidentitytoken)

### Accessors

- [http](modules_cache_client.CacheClient.md#http)
Expand Down Expand Up @@ -77,16 +73,6 @@
| :------ | :------ |
| `_signerService` | [`SignerService`](modules_signer.SignerService.md) |

## Properties

### pubKeyAndIdentityToken

**pubKeyAndIdentityToken**: `undefined` \| [`IPubKeyAndIdentityToken`](../interfaces/modules_signer.IPubKeyAndIdentityToken.md)

#### Implementation of

[ICacheClient](../interfaces/modules_cache_client.ICacheClient.md).[pubKeyAndIdentityToken](../interfaces/modules_cache_client.ICacheClient.md#pubkeyandidentitytoken)

## Accessors

### http
Expand Down Expand Up @@ -143,11 +129,6 @@ ___

**authenticate**(): `Promise`<`void`\>

**`Description`**

Refreshes access token. If login still fails then signs new identity token and requests access token
After authentication runs previously failed requests

#### Returns

`Promise`<`void`\>
Expand Down Expand Up @@ -797,26 +778,16 @@ ___

`boolean`

#### Implementation of

ICacheClient.isAuthEnabled

___

### isAuthenticated

**isAuthenticated**(): `Promise`<`boolean`\>

Checks that auth token has been created, has not expired and corresponds to signer.
This is done by a request to the server because the auth token is stored in an HTTP-only cookie and
so the Javascript has no way to check its validity

#### Returns

`Promise`<`boolean`\>

true if cache client is authenticated server

___

### issueClaim
Expand Down Expand Up @@ -844,17 +815,10 @@ ___

**login**(): `Promise`<`void`\>

Verifies current session and establishes new one if needed
https://energyweb.atlassian.net/wiki/spaces/MYEN/pages/2303295607/ICL-+ICS+Auth+Process

#### Returns

`Promise`<`void`\>

#### Implementation of

ICacheClient.login

___

### persistCredentialStatusUpdate
Expand Down
22 changes: 0 additions & 22 deletions docs/api/interfaces/modules_cache_client.AuthTokens.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@

### Properties

- [auth](modules_cache_client.CacheServerClientOptions.md#auth)
- [cacheServerSupportsAuth](modules_cache_client.CacheServerClientOptions.md#cacheserversupportsauth)
- [url](modules_cache_client.CacheServerClientOptions.md#url)

## Properties

### auth

**auth**: `SiweOptions`

___

### cacheServerSupportsAuth

`Optional` **cacheServerSupportsAuth**: `boolean`
Expand Down
37 changes: 0 additions & 37 deletions docs/api/interfaces/modules_cache_client.ICacheClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@
- [getRolesByRevoker](modules_cache_client.ICacheClient.md#getrolesbyrevoker)
- [getRolesDefinition](modules_cache_client.ICacheClient.md#getrolesdefinition)
- [getSubOrganizationsByOrganization](modules_cache_client.ICacheClient.md#getsuborganizationsbyorganization)
- [isAuthEnabled](modules_cache_client.ICacheClient.md#isauthenabled)
- [issueClaim](modules_cache_client.ICacheClient.md#issueclaim)
- [login](modules_cache_client.ICacheClient.md#login)
- [pubKeyAndIdentityToken](modules_cache_client.ICacheClient.md#pubkeyandidentitytoken)
- [rejectClaim](modules_cache_client.ICacheClient.md#rejectclaim)
- [requestClaim](modules_cache_client.ICacheClient.md#requestclaim)

Expand Down Expand Up @@ -636,20 +633,6 @@ ___

___

### isAuthEnabled

**isAuthEnabled**: () => `boolean`

#### Type declaration

▸ (): `boolean`

##### Returns

`boolean`

___

### issueClaim

**issueClaim**: (`issuer`: `string`, `message`: [`IClaimIssuance`](modules_claims.IClaimIssuance.md)) => `Promise`<`void`\>
Expand All @@ -671,26 +654,6 @@ ___

___

### login

**login**: () => `Promise`<`void`\>

#### Type declaration

▸ (): `Promise`<`void`\>

##### Returns

`Promise`<`void`\>

___

### pubKeyAndIdentityToken

**pubKeyAndIdentityToken**: `undefined` \| [`IPubKeyAndIdentityToken`](modules_signer.IPubKeyAndIdentityToken.md)

___

### rejectClaim

**rejectClaim**: (`issuer`: `string`, `message`: [`IClaimRejection`](modules_claims.IClaimRejection.md)) => `Promise`<`void`\>
Expand Down
11 changes: 0 additions & 11 deletions docs/api/modules/modules_cache_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

### Interfaces

- [AuthTokens](../interfaces/modules_cache_client.AuthTokens.md)
- [CacheServerClientOptions](../interfaces/modules_cache_client.CacheServerClientOptions.md)
- [ICacheClient](../interfaces/modules_cache_client.ICacheClient.md)

Expand All @@ -22,10 +21,6 @@
- [AssetsFilter](modules_cache_client.md#assetsfilter)
- [ClaimsFilter](modules_cache_client.md#claimsfilter)

### Variables

- [TEST\_LOGIN\_ENDPOINT](modules_cache_client.md#test_login_endpoint)

## Type Aliases

### AssetsFilter
Expand Down Expand Up @@ -53,9 +48,3 @@ ___
| :------ | :------ |
| `isAccepted?` | `boolean` |
| `namespace?` | `string` |

## Variables

### TEST\_LOGIN\_ENDPOINT

`Const` **TEST\_LOGIN\_ENDPOINT**: ``"/auth/status"``
Loading

0 comments on commit 194a95d

Please sign in to comment.