@cumulus/launchpad-auth
    TypeScript icon, indicating that this package has built-in type declarations

    9.6.0 • Public • Published

    @cumulus/launchpad-auth

    Utilities for authentication by Cumulus using Launchpad.

    Usage

      npm install @cumulus/launchpad-auth

    API

    Modules

    launchpad-auth

    Utility functions for generating and validating Launchpad tokens

    Classes

    LaunchpadToken

    A class for sending requests to Launchpad token service endpoints

    launchpad-auth

    Utility functions for generating and validating Launchpad tokens

    getLaunchpadToken(params) ⇒ Promise.<string>

    Get a Launchpad token

    Kind: Exported function
    Returns: Promise.<string> - - the Launchpad token

    Param Type Description
    params Object the configuration parameters for creating LaunchpadToken object
    params.api string the Launchpad token service api endpoint
    params.passphrase string the passphrase of the Launchpad PKI certificate
    params.certificate string the name of the Launchpad PKI pfx certificate

    validateLaunchpadToken(params, token, [userGroup]) ⇒ Promise.<ValidateTokenResult>

    Validate a Launchpad token

    Kind: Exported function
    Returns: Promise.<ValidateTokenResult> - - the validate result object with { status: 'success or failed', message: 'reason for failure', session_maxtimeout: number second, session_starttime: number millisecond, owner_auid: string}

    Param Type Description
    params Object the configuration parameters for creating LaunchpadToken object
    params.api string the Launchpad token service api endpoint
    params.passphrase string the passphrase of the Launchpad PKI certificate
    params.certificate string the name of the Launchpad PKI pfx certificate
    token string the token to be validated
    [userGroup] string the cumulus user group that a valid user should belong to

    LaunchpadToken

    A class for sending requests to Launchpad token service endpoints

    Kind: global class

    new LaunchpadToken(params)

    Param Type Description
    params Object
    params.api string the Launchpad token service api endpoint
    params.passphrase string the passphrase of the Launchpad PKI certificate
    params.certificate string the name of the Launchpad PKI pfx certificate

    Example

    const LaunchpadToken = require('@cumulus/launchpad-auth/LaunchpadToken');
    
    const launchpadToken = new LaunchpadToken({
     api: 'launchpad-token-api-endpoint',
     passphrase: 'my-pki-passphrase',
     certificate: 'my-pki-certificate.pfx'
    });

    launchpadToken.requestToken() ⇒ Promise.<Object>

    Get a token from Launchpad

    Kind: instance method of LaunchpadToken
    Returns: Promise.<Object> - - the Launchpad gettoken response object

    launchpadToken.validateToken(token) ⇒ Promise.<Object>

    Validate a Launchpad token

    Kind: instance method of LaunchpadToken
    Returns: Promise.<Object> - - the Launchpad validate token response object

    Param Type Description
    token string the Launchpad token for validation

    About Cumulus

    Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's future Earth science data streams.

    Cumulus Documentation

    Contributing

    To make a contribution, please see our contributing guidelines.


    Generated automatically using npm run build-docs

    Keywords

    Install

    npm i @cumulus/launchpad-auth

    DownloadsWeekly Downloads

    311

    Version

    9.6.0

    License

    Apache-2.0

    Unpacked Size

    46.6 kB

    Total Files

    25

    Last publish

    Collaborators

    • botanical
    • aortega527
    • cumuluspublisher
    • mboyd
    • lfrederick
    • nemreid
    • kkelly51
    • nsidc_kovarik
    • flamingbear
    • jennyhliu
    • npauzenga
    • dopeters