speakeasy
speakeasy copied to clipboard
Can we have a v3 release?
There are a bunch of things such as making issuer work correctly, there hasn't been a release since a year, can we perhaps have a v3-rc?
Sorry for the delay. I'm thinking about what to do about the breaking changes but will work on a 3.0 release soon.
Maybe port the entire thing to typescript? 😛
@SimonSchick already did that at https://github.com/speakeasyjs/libotp
Contributions welcome!
@markbao I created some typings for our own consumption, maybe you want to ship these in case you don't want a TS rewrite:
declare module 'speakeasy' {
export interface IBaseOptions {
secret: string;
counter?: number;
encoding?: 'ascii' | 'hex' | 'base32' | 'base64';
algorithm?: 'sha1' | 'sha256' | 'sha512';
}
export interface IDigitOptions extends IBaseOptions {
digits?: number;
}
export interface IVerifyOptions {
token: string;
window?: number;
}
export interface IHOTPFunction {
(options: IDigitOptions & { digest?: Buffer }): string;
verifyDelta(options: IDigitOptions & IVerifyOptions): { delta: number } | void;
verify(options: IDigitOptions & IVerifyOptions): boolean;
}
export interface ITOTPOptions extends IDigitOptions {
time?: number;
step?: number;
epoch?: number;
}
export interface ISecret {
ascii: string;
hex: string;
base32: string;
otpauth_url: string;
}
export interface ITOPTFunction {
(options: ITOTPOptions): string;
verifyDelta(options: ITOTPOptions & IVerifyOptions): { delta: number } | void;
verify(options: ITOTPOptions & IVerifyOptions): boolean;
}
export function digest (options: IBaseOptions): Buffer;
export const hotp: IHOTPFunction;
export const totp: ITOPTFunction;
export function generateSecret(options?: {
length?: number;
symbols?: boolean;
otpauth_url?: boolean;
name?: string;
issuer?: string;
}): ISecret;
export function genereateSecretASCII(length: number = 32, symbols: boolean = false): string;
export function otpauthURL(options: IBaseOptions & {
label: string;
type?: 'totp' | 'hotp';
issuer?: string;
period?: number;
}): string;
}
@SimonSchick Have time to try https://github.com/speakeasyjs/libotp ?
Any news on version 3.0?