/*
 * Copyright (c) 2023-2025 Datalayer, Inc.
 * Distributed under the terms of the Modified BSD License.
 */
export class IAMProvidersSpecs {
    constructor() { }
    static getProvider(providerIAMProvidersType) {
        switch (providerIAMProvidersType) {
            case 'bluesky': {
                return this.Bluesky;
            }
            case 'github': {
                return this.GitHub;
            }
            case 'google': {
                return this.Google;
            }
            case 'linkedin': {
                return this.LinkedIn;
            }
            case 'okta': {
                return this.Okta;
            }
            default: {
                // TODO revisit this...
                return this.GitHub;
            }
        }
    }
    static Bluesky = {
        name: 'bluesky',
        oauth2CallbackServerRoute: 'jupyter_iam/oauth2/callback',
        oauth2CallbackUIRoute: '/iam/oauth2/bluesky/callback',
        accessTokenCookieName: (user) => `__datalayer__bluesky_access_token_${user.id}`,
        refreshTokenCookieName: '__datalayer__bluesky_refresh_token',
        userInfoURL: '',
        tokenRefreshURL: '',
        postShareURL: '',
        registerUploadURL: '',
    };
    static GitHub = {
        name: 'github',
        oauth2CallbackServerRoute: 'jupyter_iam/oauth2/callback',
        oauth2CallbackUIRoute: '/iam/oauth2/github/callback',
        accessTokenCookieName: (user) => `__datalayer__github_access_token_${user.id}`,
        refreshTokenCookieName: '__datalayer__github_refresh_token',
        userInfoURL: 'https://api.github.com/user',
        tokenRefreshURL: 'https://github.com/login/oauth/access_token',
        postShareURL: '',
        registerUploadURL: '',
    };
    static Google = {
        name: 'google',
        oauth2CallbackServerRoute: 'jupyter_iam/oauth2/callback',
        oauth2CallbackUIRoute: '/iam/oauth2/google/callback',
        accessTokenCookieName: (user) => `__datalayer__google_access_token_${user.id}`,
        refreshTokenCookieName: '__datalayer__google_refresh_token',
        userInfoURL: 'https://openidconnect.googleapis.com/v1/userinfo',
        tokenRefreshURL: 'https://oauth2.googleapis.com/token',
        postShareURL: '',
        registerUploadURL: '',
    };
    static LinkedIn = {
        name: 'linkedin',
        oauth2CallbackServerRoute: 'jupyter_iam/oauth2/callback',
        oauth2CallbackUIRoute: '/iam/oauth2/linkedin/callback',
        accessTokenCookieName: (user) => `__datalayer__linkedin_access_token_${user.id}`,
        refreshTokenCookieName: '__datalayer__linkedin_refresh_token',
        userInfoURL: 'https://api.linkedin.com/v2/userinfo',
        tokenRefreshURL: '',
        postShareURL: 'https://api.linkedin.com/v2/ugcPosts',
        registerUploadURL: 'https://api.linkedin.com/v2/assets?action=registerUpload',
    };
    static Okta = {
        name: 'okta',
        oauth2CallbackServerRoute: 'jupyter_iam/oauth2/callback',
        oauth2CallbackUIRoute: '/iam/oauth2/linkedin/callback',
        accessTokenCookieName: (user) => `__datalayer__okta_access_token_${user.id}`,
        refreshTokenCookieName: '__datalayer__okta_refresh_token',
        userInfoURL: 'https://trial-4368308.okta.com/oauth2/default/v1/userinfo',
        tokenRefreshURL: '',
        postShareURL: '',
        registerUploadURL: '',
    };
}
export default IAMProvidersSpecs;
