Implemented a registration key for organisations

ref #112
This commit is contained in:
2021-01-21 17:30:43 +01:00
parent dee36395a6
commit d490247d1e
2 changed files with 27 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
import { IsInt, IsOptional } from "class-validator";
import { IsInt, IsOptional, IsString } from "class-validator";
import { ChildEntity, Column, OneToMany } from "typeorm";
import { ResponseRunnerOrganisation } from '../responses/ResponseRunnerOrganisation';
import { Address } from './Address';
@@ -27,6 +27,16 @@ export class RunnerOrganisation extends RunnerGroup {
@OneToMany(() => RunnerTeam, team => team.parentGroup, { nullable: true })
teams: RunnerTeam[];
/**
* The organisation's api key for self-service registration.
* The api key can be used for the /runners/register/:token endpoint.
* Is has to be base64 encoded if used via the api (to keep url-safety).
*/
@Column({ nullable: true })
@IsString()
@IsOptional()
key?: string;
/**
* Returns all runners associated with this organisation (directly or indirectly via teams).
*/