This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mirko Mollik <mirko.mollik@fit.fraunhofer.de>
Showing
51 changed files
with
741 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
{ | ||
"files.eol": "\n", | ||
"cSpell.words": ["keycloak", "sphereon"] | ||
"cSpell.words": ["keycloak", "sphereon"], | ||
"sqltools.connections": [ | ||
{ | ||
"previewLimit": 50, | ||
"server": "localhost", | ||
"port": 5432, | ||
"driver": "PostgreSQL", | ||
"database": "nestjs", | ||
"username": "csalkfenvcda", | ||
"password": "hwafkjhea", | ||
"name": "Wallet-DB" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { Column, CreateDateColumn, Entity, PrimaryColumn } from 'typeorm'; | ||
|
||
type HistoryStatus = 'pending' | 'accepted' | 'declined'; | ||
|
||
@Entity() | ||
export class History { | ||
/** | ||
* Unique ID of the history entry | ||
*/ | ||
@PrimaryColumn({ primary: true }) | ||
id: string; | ||
|
||
/** | ||
* The user that owns the key | ||
*/ | ||
@Column({ primary: true }) | ||
user: string; | ||
|
||
/** | ||
* Values | ||
*/ | ||
@Column() | ||
value: string; | ||
|
||
/** | ||
* Relying party | ||
*/ | ||
@Column() | ||
relyingParty: string; | ||
|
||
/** | ||
* | ||
*/ | ||
@Column() | ||
relyingPartyLogo: string; | ||
|
||
/** | ||
* Status of the history entry | ||
*/ | ||
@ApiProperty({ type: 'string', enum: ['pending', 'accepted', 'declined'] }) | ||
@Column() | ||
status: HistoryStatus; | ||
|
||
/** | ||
* Date of creation | ||
*/ | ||
@CreateDateColumn() | ||
created_at: Date; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { HistoryController } from './history.controller'; | ||
|
||
describe('HistoryController', () => { | ||
let controller: HistoryController; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [HistoryController], | ||
}).compile(); | ||
|
||
controller = module.get<HistoryController>(HistoryController); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Controller, Get, Param, UseGuards } from '@nestjs/common'; | ||
import { ApiOAuth2, ApiOperation, ApiTags } from '@nestjs/swagger'; | ||
import { AuthGuard, AuthenticatedUser } from 'nest-keycloak-connect'; | ||
import { HistoryService } from './history.service'; | ||
import { KeycloakUser } from 'src/auth/user'; | ||
|
||
@UseGuards(AuthGuard) | ||
@ApiOAuth2([]) | ||
@ApiTags('history') | ||
@Controller('history') | ||
export class HistoryController { | ||
constructor(private historyService: HistoryService) {} | ||
|
||
@ApiOperation({ summary: 'get all elements' }) | ||
@Get() | ||
all(@AuthenticatedUser() user: KeycloakUser) { | ||
return this.historyService.all(user.sub); | ||
} | ||
|
||
@ApiOperation({ summary: 'get one element' }) | ||
@Get(':id') | ||
getOne(@AuthenticatedUser() user: KeycloakUser, @Param('id') id: string) { | ||
return this.historyService.getOne(id, user.sub); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { HistoryController } from './history.controller'; | ||
import { HistoryService } from './history.service'; | ||
import { History } from './entities/history.entity'; | ||
|
||
@Module({ | ||
imports: [TypeOrmModule.forFeature([History])], | ||
controllers: [HistoryController], | ||
providers: [HistoryService], | ||
exports: [HistoryService], | ||
}) | ||
export class HistoryModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { HistoryService } from './history.service'; | ||
|
||
describe('HistoryService', () => { | ||
let service: HistoryService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [HistoryService], | ||
}).compile(); | ||
|
||
service = module.get<HistoryService>(HistoryService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { History } from './entities/history.entity'; | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
import { Repository } from 'typeorm'; | ||
|
||
@Injectable() | ||
export class HistoryService { | ||
constructor( | ||
@InjectRepository(History) | ||
private historyRepository: Repository<History> | ||
) {} | ||
|
||
all(user: string) { | ||
return this.historyRepository.find({ where: { user } }); | ||
} | ||
|
||
getOne(id: string, user: string) { | ||
return this.historyRepository.findOne({ where: { id, user } }); | ||
} | ||
|
||
add( | ||
session: string, | ||
user: string, | ||
relyingParty: string, | ||
logo: string, | ||
url: string | ||
) { | ||
const history = new History(); | ||
history.id = session; | ||
history.user = user; | ||
history.relyingParty = relyingParty; | ||
history.relyingPartyLogo = logo; | ||
history.value = url; | ||
history.status = 'pending'; | ||
return this.historyRepository.save(history); | ||
} | ||
|
||
setStatus(id: string, status: 'accepted' | 'declined') { | ||
return this.historyRepository.update({ id }, { status }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta charset="utf-8" /> | ||
<title>Wallet</title> | ||
<base href="/"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/> | ||
<link rel="manifest" href="manifest.webmanifest"> | ||
<meta name="theme-color" content="#1976d2"> | ||
</head> | ||
<base href="/" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link | ||
href="https://fonts.googleapis.com/icon?family=Material+Icons" | ||
rel="stylesheet" | ||
/> | ||
<link rel="manifest" href="manifest.webmanifest" /> | ||
<meta name="theme-color" content="#D7E3FF" /> | ||
</head> | ||
<body> | ||
<app-root></app-root> | ||
<noscript>Please enable JavaScript to continue using this application.</noscript> | ||
</body> | ||
<noscript | ||
>Please enable JavaScript to continue using this application.</noscript | ||
> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,83 @@ | ||
{ | ||
"name": "Wallet", | ||
"short_name": "Wallet", | ||
"theme_color": "#1976d2", | ||
"background_color": "#fafafa", | ||
"theme_color": "#D7E3FF", | ||
"background_color": "#FFFFFF", | ||
"display": "standalone", | ||
"description": "A client to connect to a cloud wallet", | ||
"id": "/", | ||
"scope": "./", | ||
"start_url": "./", | ||
"screenshots": [ | ||
{ | ||
"src": "assets/screenshot/main.png", | ||
"sizes": "750x1334", | ||
"type": "image/png", | ||
"form_factor": "narrow", | ||
"label": "Home screen of the credentials" | ||
}, | ||
{ | ||
"src": "assets/screenshot/main-wide.png", | ||
"sizes": "1536x1476", | ||
"type": "image/png", | ||
"form_factor": "wide", | ||
"label": "Home screen of the credentials" | ||
} | ||
], | ||
"icons": [ | ||
{ | ||
"src": "assets/icons/icon-72x72.png", | ||
"sizes": "72x72", | ||
"type": "image/png", | ||
"purpose": "maskable any" | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "assets/icons/icon-96x96.png", | ||
"sizes": "96x96", | ||
"type": "image/png", | ||
"purpose": "maskable any" | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "assets/icons/icon-128x128.png", | ||
"sizes": "128x128", | ||
"type": "image/png", | ||
"purpose": "maskable any" | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "assets/icons/icon-144x144.png", | ||
"sizes": "144x144", | ||
"type": "image/png", | ||
"purpose": "maskable any" | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "assets/icons/icon-152x152.png", | ||
"sizes": "152x152", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "assets/icons/icon-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "assets/icons/maskable_icon-72x72.png", | ||
"sizes": "72x72", | ||
"type": "image/png", | ||
"purpose": "maskable any" | ||
"purpose": "maskable" | ||
}, | ||
{ | ||
"src": "assets/icons/icon-192x192.png", | ||
"sizes": "192x192", | ||
"src": "assets/icons/maskable_icon-96x96.png", | ||
"sizes": "96x96", | ||
"type": "image/png", | ||
"purpose": "maskable any" | ||
"purpose": "maskable" | ||
}, | ||
{ | ||
"src": "assets/icons/icon-384x384.png", | ||
"sizes": "384x384", | ||
"src": "assets/icons/maskable_icon-128x128.png", | ||
"sizes": "128x128", | ||
"type": "image/png", | ||
"purpose": "maskable any" | ||
"purpose": "maskable" | ||
}, | ||
{ | ||
"src": "assets/icons/icon-512x512.png", | ||
"src": "assets/icons/maskable_icon-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png", | ||
"purpose": "maskable any" | ||
"purpose": "maskable" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
export * from './credentials.service'; | ||
import { CredentialsApiService } from './credentials.service'; | ||
export * from './history.service'; | ||
import { HistoryApiService } from './history.service'; | ||
export * from './keys.service'; | ||
import { KeysApiService } from './keys.service'; | ||
export * from './oid4vci.service'; | ||
import { Oid4vciApiService } from './oid4vci.service'; | ||
export * from './oid4vcp.service'; | ||
import { Oid4vcpApiService } from './oid4vcp.service'; | ||
export const APIS = [CredentialsApiService, KeysApiService, Oid4vciApiService, Oid4vcpApiService]; | ||
export const APIS = [CredentialsApiService, HistoryApiService, KeysApiService, Oid4vciApiService, Oid4vcpApiService]; |
232 changes: 232 additions & 0 deletions
232
apps/holder/projects/shared/api/kms/api/history.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,232 @@ | ||
/** | ||
* API | ||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
* | ||
* The version of the OpenAPI document: 1.0 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
/* tslint:disable:no-unused-variable member-ordering */ | ||
|
||
import { Inject, Injectable, Optional } from '@angular/core'; | ||
import { HttpClient, HttpHeaders, HttpParams, | ||
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext | ||
} from '@angular/common/http'; | ||
import { CustomHttpParameterCodec } from '../encoder'; | ||
import { Observable } from 'rxjs'; | ||
|
||
// @ts-ignore | ||
import { History } from '../model/history'; | ||
|
||
// @ts-ignore | ||
import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; | ||
import { Configuration } from '../configuration'; | ||
|
||
|
||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class HistoryApiService { | ||
|
||
protected basePath = 'http://localhost'; | ||
public defaultHeaders = new HttpHeaders(); | ||
public configuration = new Configuration(); | ||
public encoder: HttpParameterCodec; | ||
|
||
constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { | ||
if (configuration) { | ||
this.configuration = configuration; | ||
} | ||
if (typeof this.configuration.basePath !== 'string') { | ||
if (Array.isArray(basePath) && basePath.length > 0) { | ||
basePath = basePath[0]; | ||
} | ||
|
||
if (typeof basePath !== 'string') { | ||
basePath = this.basePath; | ||
} | ||
this.configuration.basePath = basePath; | ||
} | ||
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); | ||
} | ||
|
||
|
||
// @ts-ignore | ||
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { | ||
if (typeof value === "object" && value instanceof Date === false) { | ||
httpParams = this.addToHttpParamsRecursive(httpParams, value); | ||
} else { | ||
httpParams = this.addToHttpParamsRecursive(httpParams, value, key); | ||
} | ||
return httpParams; | ||
} | ||
|
||
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { | ||
if (value == null) { | ||
return httpParams; | ||
} | ||
|
||
if (typeof value === "object") { | ||
if (Array.isArray(value)) { | ||
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); | ||
} else if (value instanceof Date) { | ||
if (key != null) { | ||
httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); | ||
} else { | ||
throw Error("key may not be null if value is Date"); | ||
} | ||
} else { | ||
Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( | ||
httpParams, value[k], key != null ? `${key}.${k}` : k)); | ||
} | ||
} else if (key != null) { | ||
httpParams = httpParams.append(key, value); | ||
} else { | ||
throw Error("key may not be null if value is not object or array"); | ||
} | ||
return httpParams; | ||
} | ||
|
||
/** | ||
* get all elements | ||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||
* @param reportProgress flag to report request and response progress. | ||
*/ | ||
public historyControllerAll(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<History>>; | ||
public historyControllerAll(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<History>>>; | ||
public historyControllerAll(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<History>>>; | ||
public historyControllerAll(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | ||
|
||
let localVarHeaders = this.defaultHeaders; | ||
|
||
let localVarCredential: string | undefined; | ||
// authentication (oauth2) required | ||
localVarCredential = this.configuration.lookupCredential('oauth2'); | ||
if (localVarCredential) { | ||
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | ||
} | ||
|
||
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | ||
if (localVarHttpHeaderAcceptSelected === undefined) { | ||
// to determine the Accept header | ||
const httpHeaderAccepts: string[] = [ | ||
'application/json' | ||
]; | ||
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | ||
} | ||
if (localVarHttpHeaderAcceptSelected !== undefined) { | ||
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | ||
} | ||
|
||
let localVarHttpContext: HttpContext | undefined = options && options.context; | ||
if (localVarHttpContext === undefined) { | ||
localVarHttpContext = new HttpContext(); | ||
} | ||
|
||
let localVarTransferCache: boolean | undefined = options && options.transferCache; | ||
if (localVarTransferCache === undefined) { | ||
localVarTransferCache = true; | ||
} | ||
|
||
|
||
let responseType_: 'text' | 'json' | 'blob' = 'json'; | ||
if (localVarHttpHeaderAcceptSelected) { | ||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | ||
responseType_ = 'text'; | ||
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | ||
responseType_ = 'json'; | ||
} else { | ||
responseType_ = 'blob'; | ||
} | ||
} | ||
|
||
let localVarPath = `/history`; | ||
return this.httpClient.request<Array<History>>('get', `${this.configuration.basePath}${localVarPath}`, | ||
{ | ||
context: localVarHttpContext, | ||
responseType: <any>responseType_, | ||
withCredentials: this.configuration.withCredentials, | ||
headers: localVarHeaders, | ||
observe: observe, | ||
transferCache: localVarTransferCache, | ||
reportProgress: reportProgress | ||
} | ||
); | ||
} | ||
|
||
/** | ||
* get one element | ||
* @param id | ||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||
* @param reportProgress flag to report request and response progress. | ||
*/ | ||
public historyControllerGetOne(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<History>; | ||
public historyControllerGetOne(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<History>>; | ||
public historyControllerGetOne(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<History>>; | ||
public historyControllerGetOne(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | ||
if (id === null || id === undefined) { | ||
throw new Error('Required parameter id was null or undefined when calling historyControllerGetOne.'); | ||
} | ||
|
||
let localVarHeaders = this.defaultHeaders; | ||
|
||
let localVarCredential: string | undefined; | ||
// authentication (oauth2) required | ||
localVarCredential = this.configuration.lookupCredential('oauth2'); | ||
if (localVarCredential) { | ||
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | ||
} | ||
|
||
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | ||
if (localVarHttpHeaderAcceptSelected === undefined) { | ||
// to determine the Accept header | ||
const httpHeaderAccepts: string[] = [ | ||
'application/json' | ||
]; | ||
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | ||
} | ||
if (localVarHttpHeaderAcceptSelected !== undefined) { | ||
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | ||
} | ||
|
||
let localVarHttpContext: HttpContext | undefined = options && options.context; | ||
if (localVarHttpContext === undefined) { | ||
localVarHttpContext = new HttpContext(); | ||
} | ||
|
||
let localVarTransferCache: boolean | undefined = options && options.transferCache; | ||
if (localVarTransferCache === undefined) { | ||
localVarTransferCache = true; | ||
} | ||
|
||
|
||
let responseType_: 'text' | 'json' | 'blob' = 'json'; | ||
if (localVarHttpHeaderAcceptSelected) { | ||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | ||
responseType_ = 'text'; | ||
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | ||
responseType_ = 'json'; | ||
} else { | ||
responseType_ = 'blob'; | ||
} | ||
} | ||
|
||
let localVarPath = `/history/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; | ||
return this.httpClient.request<History>('get', `${this.configuration.basePath}${localVarPath}`, | ||
{ | ||
context: localVarHttpContext, | ||
responseType: <any>responseType_, | ||
withCredentials: this.configuration.withCredentials, | ||
headers: localVarHeaders, | ||
observe: observe, | ||
transferCache: localVarTransferCache, | ||
reportProgress: reportProgress | ||
} | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* API | ||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
* | ||
* The version of the OpenAPI document: 1.0 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
export interface History { | ||
/** | ||
* Status of the history entry | ||
*/ | ||
status: History.StatusEnum; | ||
/** | ||
* Unique ID of the history entry | ||
*/ | ||
id: string; | ||
/** | ||
* The user that owns the key | ||
*/ | ||
user: string; | ||
/** | ||
* Values | ||
*/ | ||
value: string; | ||
/** | ||
* Relying party | ||
*/ | ||
relyingParty: string; | ||
relyingPartyLogo: string; | ||
/** | ||
* Date of creation | ||
*/ | ||
created_at: string; | ||
} | ||
export namespace History { | ||
export type StatusEnum = 'pending' | 'accepted' | 'declined'; | ||
export const StatusEnum = { | ||
pending: 'pending' as StatusEnum, | ||
accepted: 'accepted' as StatusEnum, | ||
declined: 'declined' as StatusEnum | ||
}; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/holder/projects/shared/credentials/credentials-list/credentials-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
apps/holder/projects/shared/history/history-list/history-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<h3>History</h3> | ||
<mat-nav-list> | ||
@for (history of values; track history) { | ||
<a mat-list-item [routerLink]="history.id"> | ||
<!-- <img matListAvatar [src]="history.relyingPartyLogo" alt="logo" /> --> | ||
<mat-icon | ||
matListItemIcon | ||
[ngClass]="{ | ||
success: history.status === 'accepted', | ||
declined: history.status === 'declined' | ||
}" | ||
>call_made</mat-icon | ||
> | ||
<h3 matListItemTitle>{{ history.relyingParty }}</h3> | ||
<p matListItemLine>{{ history.created_at | date: 'medium' }}</p> | ||
</a> | ||
} | ||
</mat-nav-list> |
12 changes: 12 additions & 0 deletions
12
apps/holder/projects/shared/history/history-list/history-list.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
:host { | ||
padding: 16px; | ||
display: block; | ||
} | ||
|
||
.success { | ||
color: #66BB6A !important; | ||
} | ||
|
||
.declined { | ||
color: #B71C1C !important; | ||
} |
23 changes: 23 additions & 0 deletions
23
apps/holder/projects/shared/history/history-list/history-list.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { HistoryListComponent } from './history-list.component'; | ||
|
||
describe('HistoryListComponent', () => { | ||
let component: HistoryListComponent; | ||
let fixture: ComponentFixture<HistoryListComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [HistoryListComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(HistoryListComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
25 changes: 25 additions & 0 deletions
25
apps/holder/projects/shared/history/history-list/history-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { History, HistoryApiService } from '../../api/kms'; | ||
import { firstValueFrom } from 'rxjs'; | ||
import { MatListModule } from '@angular/material/list'; | ||
import { CommonModule } from '@angular/common'; | ||
import { RouterModule } from '@angular/router'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
|
||
@Component({ | ||
selector: 'app-history-list', | ||
standalone: true, | ||
imports: [CommonModule, RouterModule, MatListModule, MatIconModule], | ||
templateUrl: './history-list.component.html', | ||
styleUrl: './history-list.component.scss', | ||
}) | ||
export class HistoryListComponent implements OnInit { | ||
values: History[] = []; | ||
constructor(private historyApiService: HistoryApiService) {} | ||
|
||
async ngOnInit(): Promise<void> { | ||
this.values = await firstValueFrom( | ||
this.historyApiService.historyControllerAll() | ||
); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
apps/holder/projects/shared/history/history-show/history-show.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<div fxLayout="row" fxLayoutAlign="space-between center"> | ||
<div fxLayout="row" fxLayoutGap="16px" fxLayoutAlign="start center"> | ||
<button mat-icon-button [routerLink]="'../'"> | ||
<mat-icon>arrow_back</mat-icon> | ||
</button> | ||
<h3>{{ element.relyingParty }}</h3> | ||
</div> | ||
</div> | ||
<mat-card> | ||
<mat-card-content> | ||
<mat-list> | ||
<mat-list-item> | ||
<div matListItemTitle>Created at</div> | ||
<div matListItemLine>{{ element.created_at | date: 'medium' }}</div> | ||
</mat-list-item> | ||
<mat-list-item> | ||
<div matListItemTitle>Action</div> | ||
<div matListItemLine>{{ element.status }}</div> | ||
</mat-list-item> | ||
</mat-list> | ||
</mat-card-content> | ||
</mat-card> |
5 changes: 5 additions & 0 deletions
5
apps/holder/projects/shared/history/history-show/history-show.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:host { | ||
padding: 16px; | ||
display: block; | ||
max-width: 400px; | ||
} |
23 changes: 23 additions & 0 deletions
23
apps/holder/projects/shared/history/history-show/history-show.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { HistoryShowComponent } from './history-show.component'; | ||
|
||
describe('HistoryShowComponent', () => { | ||
let component: HistoryShowComponent; | ||
let fixture: ComponentFixture<HistoryShowComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [HistoryShowComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(HistoryShowComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
43 changes: 43 additions & 0 deletions
43
apps/holder/projects/shared/history/history-show/history-show.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute, Router, RouterModule } from '@angular/router'; | ||
import { History, HistoryApiService } from '../../api/kms'; | ||
import { firstValueFrom } from 'rxjs'; | ||
import { MatCardModule } from '@angular/material/card'; | ||
import { CommonModule } from '@angular/common'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
import { FlexLayoutModule } from 'ng-flex-layout'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { MatListModule } from '@angular/material/list'; | ||
|
||
@Component({ | ||
selector: 'app-history-show', | ||
standalone: true, | ||
imports: [ | ||
CommonModule, | ||
RouterModule, | ||
MatIconModule, | ||
MatCardModule, | ||
MatButtonModule, | ||
MatListModule, | ||
FlexLayoutModule, | ||
], | ||
templateUrl: './history-show.component.html', | ||
styleUrl: './history-show.component.scss', | ||
}) | ||
export class HistoryShowComponent implements OnInit { | ||
element!: History; | ||
|
||
constructor( | ||
private route: ActivatedRoute, | ||
private historyApiService: HistoryApiService, | ||
private router: Router | ||
) {} | ||
|
||
async ngOnInit(): Promise<void> { | ||
const id = this.route.snapshot.paramMap.get('id'); | ||
if (!id) this.router.navigate(['/']); | ||
this.element = await firstValueFrom( | ||
this.historyApiService.historyControllerGetOne(id as string) | ||
); | ||
} | ||
} |
6 changes: 0 additions & 6 deletions
6
apps/holder/projects/shared/keys-list/keys-list.component.html
This file was deleted.
Oops, something went wrong.
Empty file.
22 changes: 0 additions & 22 deletions
22
apps/holder/projects/shared/keys-list/keys-list.component.spec.ts
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
apps/holder/projects/shared/keys-list/keys-list.component.ts
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
apps/holder/projects/shared/oid4vc/verify-request/verify-request.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters