parseCredentials()

in lib/credentials.js [80:94]


    parseCredentials(creds) {
        if (typeof creds === 'string') {
            try {
                creds = JSON.parse(creds);
            } catch(e) {}
        }
        if (!creds || typeof creds !== 'object') return null;
        if (creds.Credentials) {
            this.identityId = creds.IdentityId;
            return creds.Credentials;
        } else if (creds.AccessKeyId) {
            return creds;
        }
        return null;
    }