Skip to content

Commit

Permalink
add schemas for SslCertProvider #35
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Werfling committed Oct 23, 2023
1 parent b340b89 commit 0bef99a
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
50 changes: 50 additions & 0 deletions schemas/src/Backend/Provider/SslCertProviders/ISslCertProvider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import {SslCertBundel} from './SslCertBundel.js';
import {SslCertCreateOptions} from "./SslCertCreateOptions.js";

/**
* The ssl certificate provider interface.
*/
export interface ISslCertProvider {

/**
* Return the keyname for provider as ident.
* @returns {string}
*/
getName(): string;

/**
* Return the title for provider (for frontend).
* @returns {string}
*/
getTitle(): string;

/**
* Is provider ready for the request by last request try.
* @param {number} lastRequest - Timestamp from last request.
* @param {number} tryCounst - Count by trys.
* @returns {boolean} By true the request can start.
*/
isReadyForRequest(lastRequest: number, tryCounst: number): boolean;

/**
* Exist a certificate by domain name.
* @param {string} domainName - Name of domain.
* @returns {boolean}
*/
existCertificate(domainName: string): Promise<boolean>;

/**
* Return when existed, the certificat bundel (cert, fullchain, privatkey).
* @param {string} domainName
* @returns {SslCertBundel|null}
*/
getCertificationBundel(domainName: string): Promise<SslCertBundel|null>;

/**
* Create a certificate by provider.
* @param {SslCertCreateOptions} options
* @returns {boolean}
*/
createCertificate(options: SslCertCreateOptions): Promise<boolean>;

}
30 changes: 30 additions & 0 deletions schemas/src/Backend/Provider/SslCertProviders/SslCertBundel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Ssl certification bundel.
*/
export type SslCertBundel = {

/**
* Certificate pem path.
* @member {string}
*/
certPem: string;

/**
* Chain pem path.
* @member {string}
*/
chainPem: string;

/**
* Full chain pem path.
* @member {string}
*/
fullChainPem: string;

/**
* Privat key pem path.
* @member {string}
*/
privatKeyPem: string;

};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Ssl certification creates options.
*/
export type SslCertCreateOptions = {

/**
* The domain name for certificate creation.
* @member {string}
*/
domainName: string;

/**
* The email for certificate notification from provider.
* @member {string}
*/
email: string;

/**
* Size of a private key, by undefinded is the default 4096.
* @member {number}
*/
keySize?: number;

};

0 comments on commit 0bef99a

Please sign in to comment.