digital signature initial setup
This commit is contained in:
parent
66bdff700c
commit
7a89597101
@ -109,6 +109,7 @@ import { LicenseInformationScreenComponent } from './screens/admin/license-infor
|
|||||||
import { DefaultColorsScreenComponent } from './screens/admin/default-colors-screen/default-colors-screen.component';
|
import { DefaultColorsScreenComponent } from './screens/admin/default-colors-screen/default-colors-screen.component';
|
||||||
import { EditColorDialogComponent } from './screens/admin/default-colors-screen/edit-color-dialog/edit-color-dialog.component';
|
import { EditColorDialogComponent } from './screens/admin/default-colors-screen/edit-color-dialog/edit-color-dialog.component';
|
||||||
import { DownloadsListScreenComponent } from './screens/downloads-list-screen/downloads-list-screen.component';
|
import { DownloadsListScreenComponent } from './screens/downloads-list-screen/downloads-list-screen.component';
|
||||||
|
import { DigitalSignatureScreenComponent } from './screens/admin/digital-signature-screen/digital-signature-screen.component';
|
||||||
|
|
||||||
export function HttpLoaderFactory(httpClient: HttpClient) {
|
export function HttpLoaderFactory(httpClient: HttpClient) {
|
||||||
return new TranslateHttpLoader(httpClient, '/assets/i18n/', '.json');
|
return new TranslateHttpLoader(httpClient, '/assets/i18n/', '.json');
|
||||||
@ -263,6 +264,14 @@ const routes = [
|
|||||||
data: {
|
data: {
|
||||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'digital-signature',
|
||||||
|
component: DigitalSignatureScreenComponent,
|
||||||
|
canActivate: [CompositeRouteGuard],
|
||||||
|
data: {
|
||||||
|
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -358,7 +367,8 @@ const matImports = [
|
|||||||
LicenseInformationScreenComponent,
|
LicenseInformationScreenComponent,
|
||||||
DefaultColorsScreenComponent,
|
DefaultColorsScreenComponent,
|
||||||
EditColorDialogComponent,
|
EditColorDialogComponent,
|
||||||
DownloadsListScreenComponent
|
DownloadsListScreenComponent,
|
||||||
|
DigitalSignatureScreenComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
|||||||
@ -8,6 +8,15 @@
|
|||||||
*ngIf="root || !!appStateService.activeRuleSet"
|
*ngIf="root || !!appStateService.activeRuleSet"
|
||||||
></a>
|
></a>
|
||||||
|
|
||||||
|
<a
|
||||||
|
class="breadcrumb"
|
||||||
|
[routerLink]="'/ui/admin/digital-signature'"
|
||||||
|
[routerLinkActiveOptions]="{ exact: true }"
|
||||||
|
routerLinkActive="active"
|
||||||
|
translate="digital-signature"
|
||||||
|
*ngIf="root"
|
||||||
|
></a>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
class="breadcrumb"
|
class="breadcrumb"
|
||||||
[routerLink]="'/ui/admin/users'"
|
[routerLink]="'/ui/admin/users'"
|
||||||
|
|||||||
@ -0,0 +1,70 @@
|
|||||||
|
<section>
|
||||||
|
<div class="page-header">
|
||||||
|
<redaction-admin-breadcrumbs [root]="true" class="flex-1"></redaction-admin-breadcrumbs>
|
||||||
|
|
||||||
|
<div class="actions">
|
||||||
|
<redaction-circle-button
|
||||||
|
*ngIf="permissionsService.isUser()"
|
||||||
|
[routerLink]="['/ui/projects/']"
|
||||||
|
class="ml-6"
|
||||||
|
icon="red:close"
|
||||||
|
tooltip="common.close"
|
||||||
|
tooltipPosition="before"
|
||||||
|
></redaction-circle-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="red-content-inner">
|
||||||
|
<div class="left-container">
|
||||||
|
<div class="left-container-content">
|
||||||
|
<form [formGroup]="digitalSignatureForm" (keyup)="formChanged()" autocomplete="off" *ngIf="digitalSignatureForm">
|
||||||
|
<input #fileInput (change)="fileChanged($event)" hidden class="file-upload-input" type="file" />
|
||||||
|
|
||||||
|
<div *ngIf="!digitalSignatureForm.get('base64EncodedPrivateKey').value" class="empty-state">
|
||||||
|
<mat-icon svgIcon="red:document"></mat-icon>
|
||||||
|
<div class="heading-l" translate="project-overview.no-data.title"></div>
|
||||||
|
<redaction-icon-button (action)="fileInput.click()" icon="red:upload" text="project-overview.no-data.action" type="primary">
|
||||||
|
</redaction-icon-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="red-input-group w-300">
|
||||||
|
<label translate="digital-signature-screen.reason.label"></label>
|
||||||
|
<input formControlName="reason" name="reason" [placeholder]="'digital-signature-screen.reason.placeholder' | translate" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="red-input-group w-300">
|
||||||
|
<label translate="digital-signature-screen.location.label"></label>
|
||||||
|
<input formControlName="location" name="location" [placeholder]="'digital-signature-screen.location.placeholder' | translate" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="red-input-group w-300">
|
||||||
|
<label translate="digital-signature-screen.contact-info.label"></label>
|
||||||
|
<input
|
||||||
|
formControlName="contactInfo"
|
||||||
|
name="contactInfo"
|
||||||
|
[placeholder]="'digital-signature-screen.contact-info.placeholder' | translate"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="red-input-group w-300">
|
||||||
|
<label translate="digital-signature-screen.password.label"></label>
|
||||||
|
<input formControlName="keySecret" name="keySecret" [placeholder]="'digital-signature-screen.password.placeholder' | translate" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="changes-box">
|
||||||
|
<redaction-icon-button
|
||||||
|
[disabled]="digitalSignatureForm.invalid"
|
||||||
|
icon="red:check-alt"
|
||||||
|
(action)="saveDigitalSignature()"
|
||||||
|
text="digital-signature-screen.action.save"
|
||||||
|
type="primary"
|
||||||
|
></redaction-icon-button>
|
||||||
|
<div (click)="removeDigitalSignature()" translate="digital-signature-screen.action.reset" class="all-caps-label cancel"></div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<redaction-full-page-loading-indicator [displayed]="!viewReady"></redaction-full-page-loading-indicator>
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
@import '../../../../assets/styles/red-mixins';
|
||||||
|
@import '../../../../assets/styles/red-variables';
|
||||||
|
|
||||||
|
.left-container {
|
||||||
|
width: 100vw;
|
||||||
|
@include inset-shadow;
|
||||||
|
|
||||||
|
.left-container-content {
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'secret';
|
||||||
|
src: url(data:font/woff;base64,d09GRgABAAAAAAusAAsAAAAAMGgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZjRmM5Y21hcAAAAYQAAAgCAAArYmjjYVVnbHlmAAAJiAAAAEEAAABQiOYj2mhlYWQAAAnMAAAALgAAADYOxVFUaGhlYQAACfwAAAAcAAAAJAqNAyNobXR4AAAKGAAAAAgAAAAIAyAAAGxvY2EAAAogAAAABgAAAAYAKAAAbWF4cAAACigAAAAeAAAAIAEOACJuYW1lAAAKSAAAAUIAAAKOcN63t3Bvc3QAAAuMAAAAHQAAAC5lhHRpeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGScwDiBgZWBgSGVtYKBgVECQjMfYEhiYmFgYGJgZWbACgLSXFMYHIAq/rNfAHK3gEmgASACAIekCT4AAHic7dhl0zDVmUXh5+XFHYK7E0IguFtwt4QQgmtwd3d3d7cED+4SXIO7u7vbsNfaUzU1fyGcu66u1adOf+6uHhgYGGpgYGDwL37/iyEHBoZZcWDQLzUw9NK/7A5if/DA8OwPOfQknBky+0P8/PPPOcd1UJ785frr/Dq/zq/z6/w3zsCgoX/xX74GRsxbcYpRB1iDB/7PGvT/DFGDenBwe8hKD1XpoSs9TKWHrfRwlR6+0iNUesRKj1T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* target the input field inexplicably to throw Chrome's AI off.
|
||||||
|
* feel free to use a more complicated selector */
|
||||||
|
input[name='keySecret'] {
|
||||||
|
font-family: 'secret';
|
||||||
|
}
|
||||||
@ -0,0 +1,113 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { DigitalSignature, DigitalSignatureControllerService } from '@redaction/red-ui-http';
|
||||||
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
|
import { NotificationService, NotificationType } from '../../../notification/notification.service';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { PermissionsService } from '../../../common/service/permissions.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'redaction-digital-signature-screen',
|
||||||
|
templateUrl: './digital-signature-screen.component.html',
|
||||||
|
styleUrls: ['./digital-signature-screen.component.scss']
|
||||||
|
})
|
||||||
|
export class DigitalSignatureScreenComponent {
|
||||||
|
public digitalSignature: DigitalSignature;
|
||||||
|
public digitalSignatureForm: FormGroup;
|
||||||
|
|
||||||
|
public viewReady = false;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private readonly _digitalSignatureControllerService: DigitalSignatureControllerService,
|
||||||
|
private readonly _notificationService: NotificationService,
|
||||||
|
private readonly _formBuilder: FormBuilder,
|
||||||
|
private readonly _translateService: TranslateService,
|
||||||
|
public readonly permissionsService: PermissionsService
|
||||||
|
) {
|
||||||
|
this.loadDigitalSignatureAndInitializeForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
saveDigitalSignature() {
|
||||||
|
const digitalSignature = {
|
||||||
|
...this.digitalSignatureForm.getRawValue()
|
||||||
|
};
|
||||||
|
|
||||||
|
this._digitalSignatureControllerService.saveDigitalSignature(digitalSignature).subscribe(
|
||||||
|
() => {
|
||||||
|
this.loadDigitalSignatureAndInitializeForm();
|
||||||
|
this._notificationService.showToastNotification(
|
||||||
|
this._translateService.instant('digital-signature-screen.action.change-success'),
|
||||||
|
null,
|
||||||
|
NotificationType.SUCCESS
|
||||||
|
);
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this._notificationService.showToastNotification(
|
||||||
|
this._translateService.instant('digital-signature-screen.action.error'),
|
||||||
|
null,
|
||||||
|
NotificationType.ERROR
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
removeDigitalSignature() {
|
||||||
|
this._digitalSignatureControllerService.deleteDigitalSignature().subscribe(
|
||||||
|
() => {
|
||||||
|
this.loadDigitalSignatureAndInitializeForm();
|
||||||
|
this._notificationService.showToastNotification(
|
||||||
|
this._translateService.instant('digital-signature-screen.action.delete-success'),
|
||||||
|
null,
|
||||||
|
NotificationType.SUCCESS
|
||||||
|
);
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this._notificationService.showToastNotification(
|
||||||
|
this._translateService.instant('digital-signature-screen.action.error'),
|
||||||
|
null,
|
||||||
|
NotificationType.ERROR
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
fileChanged(event) {
|
||||||
|
const file = event.target.files[0];
|
||||||
|
const fileReader = new FileReader();
|
||||||
|
fileReader.onload = () => {
|
||||||
|
if (typeof fileReader.result === 'string') {
|
||||||
|
this.digitalSignatureForm.get('base64EncodedPrivateKey').setValue(btoa(fileReader.result));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
fileReader.readAsText(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
loadDigitalSignatureAndInitializeForm() {
|
||||||
|
this.viewReady = false;
|
||||||
|
this._digitalSignatureControllerService
|
||||||
|
.getDigitalSignature()
|
||||||
|
.subscribe(
|
||||||
|
(digitalSignature) => {
|
||||||
|
this.digitalSignature = digitalSignature;
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.digitalSignature = {};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.add(() => {
|
||||||
|
this._initForm();
|
||||||
|
this.viewReady = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private _initForm() {
|
||||||
|
this.digitalSignatureForm = this._formBuilder.group({
|
||||||
|
contactInfo: [{ value: this.digitalSignature.contactInfo }],
|
||||||
|
location: [{ value: this.digitalSignature.location }],
|
||||||
|
keySecret: [{ value: this.digitalSignature.password }],
|
||||||
|
reason: [{ value: this.digitalSignature.reason }],
|
||||||
|
base64EncodedPrivateKey: [{ value: this.digitalSignature.base64EncodedPrivateKey }, Validators.required]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
formChanged() {}
|
||||||
|
}
|
||||||
@ -643,6 +643,7 @@
|
|||||||
"action": "New Dictionary"
|
"action": "New Dictionary"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"digital-signature": "Digital Signature",
|
||||||
"project-templates": "Project Templates",
|
"project-templates": "Project Templates",
|
||||||
"project-templates-listing": {
|
"project-templates-listing": {
|
||||||
"table-header": {
|
"table-header": {
|
||||||
@ -736,7 +737,7 @@
|
|||||||
"copyright-claim-title": "Copyright Claim",
|
"copyright-claim-title": "Copyright Claim",
|
||||||
"copyright-claim-text": "Copyright © 2020 - {{currentYear}} IQSER Technologie GmbH",
|
"copyright-claim-text": "Copyright © 2020 - {{currentYear}} IQSER Technologie GmbH",
|
||||||
"end-user-license-title": "End User License Agreement",
|
"end-user-license-title": "End User License Agreement",
|
||||||
"end-user-license-text": "The use of this product is subject to the terms of the Atlassian End User Agreement, unless other specified therein.",
|
"end-user-license-text": "The use of this product is subject to the terms of the Redaction End User Agreement, unless other specified therein.",
|
||||||
"3rd-party-title": "Reference to 3rd Party Licenses",
|
"3rd-party-title": "Reference to 3rd Party Licenses",
|
||||||
"licensing-details": "Licensing Details",
|
"licensing-details": "Licensing Details",
|
||||||
"licensed-to": "Licensed to",
|
"licensed-to": "Licensed to",
|
||||||
@ -789,5 +790,29 @@
|
|||||||
"actions": {
|
"actions": {
|
||||||
"download": "Download"
|
"download": "Download"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"digital-signature-screen": {
|
||||||
|
"title": "Digital Signature",
|
||||||
|
"reason": {
|
||||||
|
"label": "Reason",
|
||||||
|
"placeholder": "Reason"
|
||||||
|
},
|
||||||
|
"contact-info": {
|
||||||
|
"label": "Contact Information",
|
||||||
|
"placeholder": "Contact Information"
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"label": "Location",
|
||||||
|
"placeholder": "Location"
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
"label": "Certificate Password/Key",
|
||||||
|
"placeholder": "Password"
|
||||||
|
},
|
||||||
|
"action": {
|
||||||
|
"save": "Save Digital Signature",
|
||||||
|
"delete": "Delete Digital Signature",
|
||||||
|
"reset": "Reset"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import { LegalBasisMappingControllerService } from './api/legalBasisMappingContr
|
|||||||
import { WatermarkControllerService } from './api/watermarkController.service';
|
import { WatermarkControllerService } from './api/watermarkController.service';
|
||||||
import { RuleSetControllerService } from './api/ruleSetController.service';
|
import { RuleSetControllerService } from './api/ruleSetController.service';
|
||||||
import { DownloadControllerService } from './api/downloadController.service';
|
import { DownloadControllerService } from './api/downloadController.service';
|
||||||
|
import { DigitalSignatureControllerService } from './api/digitalSignatureController.service';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [],
|
imports: [],
|
||||||
@ -41,7 +42,8 @@ import { DownloadControllerService } from './api/downloadController.service';
|
|||||||
ViewedPagesControllerService,
|
ViewedPagesControllerService,
|
||||||
LegalBasisMappingControllerService,
|
LegalBasisMappingControllerService,
|
||||||
WatermarkControllerService,
|
WatermarkControllerService,
|
||||||
DownloadControllerService
|
DownloadControllerService,
|
||||||
|
DigitalSignatureControllerService
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ApiModule {
|
export class ApiModule {
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
export * from './debugController.service';
|
|
||||||
import { DebugControllerService } from './debugController.service';
|
import { DebugControllerService } from './debugController.service';
|
||||||
import { DictionaryControllerService } from './dictionaryController.service';
|
import { DictionaryControllerService } from './dictionaryController.service';
|
||||||
import { FileManagementControllerService } from './fileManagementController.service';
|
import { FileManagementControllerService } from './fileManagementController.service';
|
||||||
@ -18,6 +17,7 @@ import { VersionsControllerService } from './versionsController.service';
|
|||||||
import { ViewedPagesControllerService } from './viewedPagesController.service';
|
import { ViewedPagesControllerService } from './viewedPagesController.service';
|
||||||
import { WatermarkControllerService } from './watermarkController.service';
|
import { WatermarkControllerService } from './watermarkController.service';
|
||||||
import { DownloadControllerService } from './downloadController.service';
|
import { DownloadControllerService } from './downloadController.service';
|
||||||
|
import { DigitalSignatureControllerService } from './digitalSignatureController.service';
|
||||||
|
|
||||||
export * from './dictionaryController.service';
|
export * from './dictionaryController.service';
|
||||||
|
|
||||||
@ -55,6 +55,10 @@ export * from './watermarkController.service';
|
|||||||
|
|
||||||
export * from './downloadController.service';
|
export * from './downloadController.service';
|
||||||
|
|
||||||
|
export * from './digitalSignatureController.service';
|
||||||
|
|
||||||
|
export * from './debugController.service';
|
||||||
|
|
||||||
export const APIS = [
|
export const APIS = [
|
||||||
DebugControllerService,
|
DebugControllerService,
|
||||||
DictionaryControllerService,
|
DictionaryControllerService,
|
||||||
@ -74,5 +78,6 @@ export const APIS = [
|
|||||||
VersionsControllerService,
|
VersionsControllerService,
|
||||||
ViewedPagesControllerService,
|
ViewedPagesControllerService,
|
||||||
WatermarkControllerService,
|
WatermarkControllerService,
|
||||||
DownloadControllerService
|
DownloadControllerService,
|
||||||
|
DigitalSignatureControllerService
|
||||||
];
|
];
|
||||||
|
|||||||
@ -0,0 +1,170 @@
|
|||||||
|
/**
|
||||||
|
* API Documentation for Redaction Gateway
|
||||||
|
* Description for redaction
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/ /* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
|
import { Inject, Injectable, Optional } from '@angular/core';
|
||||||
|
import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||||
|
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import { DigitalSignature } from '../model/digitalSignature';
|
||||||
|
|
||||||
|
import { BASE_PATH } from '../variables';
|
||||||
|
import { Configuration } from '../configuration';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class DigitalSignatureControllerService {
|
||||||
|
protected basePath = '';
|
||||||
|
public defaultHeaders = new HttpHeaders();
|
||||||
|
public configuration = new Configuration();
|
||||||
|
|
||||||
|
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
|
||||||
|
if (basePath) {
|
||||||
|
this.basePath = basePath;
|
||||||
|
}
|
||||||
|
if (configuration) {
|
||||||
|
this.configuration = configuration;
|
||||||
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param consumes string[] mime-types
|
||||||
|
* @return true: consumes contains 'multipart/form-data', false: otherwise
|
||||||
|
*/
|
||||||
|
private canConsumeForm(consumes: string[]): boolean {
|
||||||
|
const form = 'multipart/form-data';
|
||||||
|
for (const consume of consumes) {
|
||||||
|
if (form === consume) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the digital signature
|
||||||
|
* None
|
||||||
|
* @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 deleteDigitalSignature(observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||||
|
public deleteDigitalSignature(observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||||
|
public deleteDigitalSignature(observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||||
|
public deleteDigitalSignature(observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||||
|
let headers = this.defaultHeaders;
|
||||||
|
|
||||||
|
// authentication (RED-OAUTH) required
|
||||||
|
if (this.configuration.accessToken) {
|
||||||
|
const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken;
|
||||||
|
headers = headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
const httpHeaderAccepts: string[] = [];
|
||||||
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
|
if (httpHeaderAcceptSelected !== undefined) {
|
||||||
|
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
const consumes: string[] = [];
|
||||||
|
|
||||||
|
return this.httpClient.request<any>('delete', `${this.basePath}/digital-signature`, {
|
||||||
|
withCredentials: this.configuration.withCredentials,
|
||||||
|
headers: headers,
|
||||||
|
observe: observe,
|
||||||
|
reportProgress: reportProgress
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current digital signature
|
||||||
|
* None
|
||||||
|
* @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 getDigitalSignature(observe?: 'body', reportProgress?: boolean): Observable<DigitalSignature>;
|
||||||
|
public getDigitalSignature(observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<DigitalSignature>>;
|
||||||
|
public getDigitalSignature(observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<DigitalSignature>>;
|
||||||
|
public getDigitalSignature(observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||||
|
let headers = this.defaultHeaders;
|
||||||
|
|
||||||
|
// authentication (RED-OAUTH) required
|
||||||
|
if (this.configuration.accessToken) {
|
||||||
|
const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken;
|
||||||
|
headers = headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
const httpHeaderAccepts: string[] = ['application/json'];
|
||||||
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
|
if (httpHeaderAcceptSelected !== undefined) {
|
||||||
|
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
const consumes: string[] = [];
|
||||||
|
|
||||||
|
return this.httpClient.request<DigitalSignature>('get', `${this.basePath}/digital-signature`, {
|
||||||
|
withCredentials: this.configuration.withCredentials,
|
||||||
|
headers: headers,
|
||||||
|
observe: observe,
|
||||||
|
reportProgress: reportProgress
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save/Update the digital signature used to sign PDF's
|
||||||
|
* None
|
||||||
|
* @param body digitalSignatureModel
|
||||||
|
* @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 saveDigitalSignature(body: DigitalSignature, observe?: 'body', reportProgress?: boolean): Observable<DigitalSignature>;
|
||||||
|
public saveDigitalSignature(body: DigitalSignature, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<DigitalSignature>>;
|
||||||
|
public saveDigitalSignature(body: DigitalSignature, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<DigitalSignature>>;
|
||||||
|
public saveDigitalSignature(body: DigitalSignature, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||||
|
if (body === null || body === undefined) {
|
||||||
|
throw new Error('Required parameter body was null or undefined when calling saveDigitalSignature.');
|
||||||
|
}
|
||||||
|
|
||||||
|
let headers = this.defaultHeaders;
|
||||||
|
|
||||||
|
// authentication (RED-OAUTH) required
|
||||||
|
if (this.configuration.accessToken) {
|
||||||
|
const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken;
|
||||||
|
headers = headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
const httpHeaderAccepts: string[] = ['application/json'];
|
||||||
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
|
if (httpHeaderAcceptSelected !== undefined) {
|
||||||
|
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
const consumes: string[] = ['application/json'];
|
||||||
|
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
||||||
|
if (httpContentTypeSelected !== undefined) {
|
||||||
|
headers = headers.set('Content-Type', httpContentTypeSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.httpClient.request<DigitalSignature>('post', `${this.basePath}/digital-signature`, {
|
||||||
|
body: body,
|
||||||
|
withCredentials: this.configuration.withCredentials,
|
||||||
|
headers: headers,
|
||||||
|
observe: observe,
|
||||||
|
reportProgress: reportProgress
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
19
libs/red-ui-http/src/lib/model/digitalSignature.ts
Normal file
19
libs/red-ui-http/src/lib/model/digitalSignature.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* API Documentation for Redaction Gateway
|
||||||
|
* Description for redaction
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface DigitalSignature {
|
||||||
|
base64EncodedPrivateKey?: string;
|
||||||
|
contactInfo?: string;
|
||||||
|
location?: string;
|
||||||
|
password?: string;
|
||||||
|
reason?: string;
|
||||||
|
}
|
||||||
@ -48,3 +48,4 @@ export * from './downloadResponse';
|
|||||||
export * from './downloadStatus';
|
export * from './downloadStatus';
|
||||||
export * from './downloadStatusResponse';
|
export * from './downloadStatusResponse';
|
||||||
export * from './prepareDownloadRequest';
|
export * from './prepareDownloadRequest';
|
||||||
|
export * from './digitalSignature';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user