Updated the method of api key creation.

ref #56
This commit is contained in:
2020-12-29 20:49:45 +01:00
parent c4270b0839
commit 04813173e4
3 changed files with 35 additions and 4 deletions

View File

@@ -31,11 +31,26 @@ export class StatsClient {
enabled: boolean = true;
/**
* The client's api key.
* This is used to authorize a statsClient against the api.
* It only grants access to the /stats/** routes.
* The client's api key prefix.
* This is used identitfy a client by it's api key.
*/
@Column({ unique: true })
@IsString()
prefix: string;
/**
* The client's api key hash.
* The api key can be used to authenticate against the /stats/** routes.
*/
@Column()
@IsString()
key: string;
/**
* The client's api key in plain text.
* This will only be used to display the full key on creation and updates.
*/
@IsString()
@IsOptional()
cleartextkey?: string;
}