mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
save work
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { ArrayMaxSize, ArrayMinSize, IsArray } from 'class-validator';
|
||||
|
||||
import { eRequestMethod } from '../enums/eRequestMethod';
|
||||
import { StratumBaseMessage } from './StratumBaseMessage';
|
||||
|
||||
export class AuthorizationMessage extends StratumBaseMessage {
|
||||
|
||||
@IsArray()
|
||||
@ArrayMinSize(2)
|
||||
@ArrayMaxSize(2)
|
||||
params: string[];
|
||||
|
||||
public username: string;
|
||||
|
||||
public password: string;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.method = eRequestMethod.AUTHORIZE;
|
||||
|
||||
}
|
||||
|
||||
public parse() {
|
||||
this.username = this.params[0];
|
||||
this.password = this.params[1];
|
||||
console.log(`Username ${this.username}, Password: ${this.password}`);
|
||||
}
|
||||
|
||||
public response() {
|
||||
return {
|
||||
id: null,
|
||||
error: null,
|
||||
result: true
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user