2021-02-16 12:28:03 +00:00
|
|
|
import { Property } from "entities/Action";
|
|
|
|
|
|
|
|
|
|
export enum AuthType {
|
|
|
|
|
NONE = "NONE",
|
|
|
|
|
OAuth2 = "oAuth2",
|
2021-05-07 11:54:05 +00:00
|
|
|
basic = "basic",
|
2021-06-25 06:45:48 +00:00
|
|
|
apiKey = "apiKey",
|
|
|
|
|
bearerToken = "bearerToken",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export enum ApiKeyAuthType {
|
|
|
|
|
QueryParams = "queryParams",
|
|
|
|
|
Header = "header",
|
2021-02-16 12:28:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export enum GrantType {
|
|
|
|
|
ClientCredentials = "client_credentials",
|
|
|
|
|
AuthorizationCode = "authorization_code",
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-25 06:45:48 +00:00
|
|
|
export type Authentication =
|
|
|
|
|
| ClientCredentials
|
|
|
|
|
| AuthorizationCode
|
|
|
|
|
| Basic
|
|
|
|
|
| ApiKey
|
|
|
|
|
| BearerToken;
|
|
|
|
|
|
2021-02-16 12:28:03 +00:00
|
|
|
export interface ApiDatasourceForm {
|
|
|
|
|
datasourceId: string;
|
|
|
|
|
pluginId: string;
|
|
|
|
|
organizationId: string;
|
|
|
|
|
isValid: boolean;
|
|
|
|
|
url: string;
|
|
|
|
|
headers?: Property[];
|
2021-12-16 12:40:38 +00:00
|
|
|
queryParameters?: Property[];
|
2021-02-16 12:28:03 +00:00
|
|
|
isSendSessionEnabled: boolean;
|
|
|
|
|
sessionSignatureKey: string;
|
|
|
|
|
authType: AuthType;
|
|
|
|
|
authentication?: Authentication;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Oauth2Common {
|
|
|
|
|
authenticationType: AuthType.OAuth2;
|
|
|
|
|
accessTokenUrl: string;
|
|
|
|
|
clientId: string;
|
|
|
|
|
clientSecret: string;
|
|
|
|
|
headerPrefix: string;
|
|
|
|
|
scopeString: string;
|
|
|
|
|
isTokenHeader: boolean;
|
2021-05-27 16:23:59 +00:00
|
|
|
audience: string;
|
|
|
|
|
resource: string;
|
2022-02-09 04:08:58 +00:00
|
|
|
sendScopeWithRefreshToken: string;
|
|
|
|
|
refreshTokenClientCredentialsLocation: string;
|
2021-02-16 12:28:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ClientCredentials extends Oauth2Common {
|
|
|
|
|
grantType: GrantType.ClientCredentials;
|
2021-12-21 04:42:26 +00:00
|
|
|
customTokenParameters: Property[];
|
2021-02-16 12:28:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface AuthorizationCode extends Oauth2Common {
|
|
|
|
|
grantType: GrantType.AuthorizationCode;
|
|
|
|
|
authorizationUrl: string;
|
|
|
|
|
customAuthenticationParameters: Property[];
|
|
|
|
|
isAuthorizationHeader: boolean;
|
|
|
|
|
isAuthorized: boolean;
|
|
|
|
|
}
|
2021-05-07 11:54:05 +00:00
|
|
|
|
|
|
|
|
export interface Basic {
|
|
|
|
|
authenticationType: AuthType.basic;
|
|
|
|
|
username: string;
|
|
|
|
|
password: string;
|
|
|
|
|
}
|
2021-06-25 06:45:48 +00:00
|
|
|
|
|
|
|
|
export interface ApiKey {
|
|
|
|
|
authenticationType: AuthType.apiKey;
|
|
|
|
|
label: string;
|
2021-09-23 07:50:44 +00:00
|
|
|
headerPrefix: string;
|
2021-06-25 06:45:48 +00:00
|
|
|
value: string;
|
|
|
|
|
addTo: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface BearerToken {
|
|
|
|
|
authenticationType: AuthType.bearerToken;
|
|
|
|
|
bearerToken: string;
|
|
|
|
|
}
|