package.dist.src.auth-client.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
Client SDK for Momento services
The newest version!
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthClient = void 0;
const internal_auth_client_1 = require("./internal/internal-auth-client");
const AbstractAuthClient_1 = require("@gomomento/sdk-core/dist/src/internal/clients/auth/AbstractAuthClient");
const sdk_core_1 = require("@gomomento/sdk-core");
const _1 = require(".");
class AuthClient extends AbstractAuthClient_1.AbstractAuthClient {
constructor(props) {
var _a, _b;
const allProps = {
...props,
configuration: (_a = props === null || props === void 0 ? void 0 : props.configuration) !== null && _a !== void 0 ? _a : getDefaultAuthClientConfiguration(),
credentialProvider: (_b = props === null || props === void 0 ? void 0 : props.credentialProvider) !== null && _b !== void 0 ? _b : (0, sdk_core_1.getDefaultCredentialProvider)(),
};
const authClient = new internal_auth_client_1.InternalAuthClient(allProps);
super({ createAuthClient: () => authClient });
}
}
exports.AuthClient = AuthClient;
function getDefaultAuthClientConfiguration() {
const config = _1.AuthClientConfigurations.Default.latest();
const logger = config.getLoggerFactory().getLogger('AuthClient');
logger.info('No configuration provided to AuthClient. Using latest "Default" configuration, suitable for development. For production use, consider specifying an explicit configuration.');
return config;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC1jbGllbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYXV0aC1jbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsMEVBQW1FO0FBRW5FLDhHQUF5RztBQUd6RyxrREFBaUU7QUFDakUsd0JBQW9FO0FBRXBFLE1BQWEsVUFBVyxTQUFRLHVDQUFrQjtJQUNoRCxZQUFZLEtBQXVCOztRQUNqQyxNQUFNLFFBQVEsR0FBdUI7WUFDbkMsR0FBRyxLQUFLO1lBQ1IsYUFBYSxFQUNY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ndXJhdGlvbiB7XG4gIGNvbnN0IGNvbmZpZyA9IEF1dGhDbGllbnRDb25maWd1cmF0aW9ucy5EZWZhdWx0LmxhdGVzdCgpO1xuICBjb25zdCBsb2dnZXIgPSBjb25maWcuZ2V0TG9nZ2VyRmFjdG9yeSgpLmdldExvZ2dlcignQXV0aENsaWVudCcpO1xuICBsb2dnZXIuaW5mbyhcbiAgICAnTm8gY29uZmlndXJhdGlvbiBwcm92aWRlZCB0byBBdXRoQ2xpZW50LiBVc2luZyBsYXRlc3QgXCJEZWZhdWx0XCIgY29uZmlndXJhdGlvbiwgc3VpdGFibGUgZm9yIGRldmVsb3BtZW50LiBGb3IgcHJvZHVjdGlvbiB1c2UsIGNvbnNpZGVyIHNwZWNpZnlpbmcgYW4gZXhwbGljaXQgY29uZmlndXJhdGlvbi4nXG4gICk7XG4gIHJldHVybiBjb25maWc7XG59XG4iXX0=
© 2015 - 2025 Weber Informatics LLC | Privacy Policy