mirror of
https://github.com/logto-io/logto.git
synced 2025-01-13 21:30:30 -05:00
8e1533a702
* feat(core): update connector db schema * feat(core): eliminate code redundancy for UTs * feat(core): delete insertConnector on conflict logic and fix UTs * feat(core): fix UI according to new connector type implementation * feat(core): removed unused getConnectorByTargetAndPlatform methods * feat(core): deprecate the function that updateConnector by giving target and platform * feat(core): keep SSOT on combination of connector and corresponding metadata * feat(core): rename index name in db
42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
import path from 'path';
|
|
|
|
import { ConnectorType, ConnectorMetadata, ConnectorPlatform } from '@logto/connector-types';
|
|
import { getFileContents } from '@logto/shared';
|
|
|
|
export const authorizationEndpoint = 'https://openauth.alipay.com/oauth2/publicAppAuthorize.htm';
|
|
export const alipayEndpoint = 'https://openapi.alipay.com/gateway.do';
|
|
export const scope = 'auth_user';
|
|
export const methodForAccessToken = 'alipay.system.oauth.token';
|
|
export const methodForUserInfo = 'alipay.user.info.share';
|
|
|
|
export const alipaySigningAlgorithmMapping = {
|
|
RSA: 'RSA-SHA1',
|
|
RSA2: 'RSA-SHA256',
|
|
} as const;
|
|
export const alipaySigningAlgorithms = ['RSA', 'RSA2'] as const;
|
|
|
|
// eslint-disable-next-line unicorn/prefer-module
|
|
const currentPath = __dirname;
|
|
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
|
|
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
|
|
const readmeContentFallback = 'Please check README.md file directory.';
|
|
const configTemplateFallback = 'Please check config-template.md file directory.';
|
|
|
|
export const defaultMetadata: ConnectorMetadata = {
|
|
target: 'alipay',
|
|
type: ConnectorType.Social,
|
|
platform: ConnectorPlatform.Web,
|
|
name: {
|
|
en: 'Sign In with Alipay',
|
|
'zh-CN': '支付宝登录',
|
|
},
|
|
logo: './logo.png',
|
|
description: {
|
|
en: 'Sign In with Alipay',
|
|
'zh-CN': '支付宝登录',
|
|
},
|
|
readme: getFileContents(pathToReadmeFile, readmeContentFallback),
|
|
configTemplate: getFileContents(pathToConfigTemplate, configTemplateFallback),
|
|
};
|
|
|
|
export const defaultTimeout = 5000;
|