speakeasy icon indicating copy to clipboard operation
speakeasy copied to clipboard

Can we have a v3 release?

Open SimonSchick opened this issue 8 years ago • 6 comments

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?

SimonSchick avatar Mar 08 '17 17:03 SimonSchick

Sorry for the delay. I'm thinking about what to do about the breaking changes but will work on a 3.0 release soon.

markbao avatar Apr 21 '17 23:04 markbao

Maybe port the entire thing to typescript? 😛

SimonSchick avatar May 01 '17 15:05 SimonSchick

@SimonSchick already did that at https://github.com/speakeasyjs/libotp

Contributions welcome!

jakelee8 avatar May 07 '17 23:05 jakelee8

@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 avatar May 10 '17 14:05 SimonSchick

@SimonSchick Have time to try https://github.com/speakeasyjs/libotp ?

jakelee8 avatar Jul 01 '17 03:07 jakelee8

Any news on version 3.0?

joaonice avatar Jan 25 '18 15:01 joaonice