2021-01-19 16:31:55 -06:00
|
|
|
import { AuthType } from "./AuthType";
|
|
|
|
import { AccessInputMetadata, DatabaseAccount } from "./Contracts/DataModels";
|
|
|
|
|
2021-01-25 13:56:15 -06:00
|
|
|
type HostedConfig = AAD | ConnectionString | EncryptedToken | ResourceToken;
|
2021-01-19 16:31:55 -06:00
|
|
|
export interface HostedExplorerChildFrame extends Window {
|
2021-01-25 13:56:15 -06:00
|
|
|
hostedConfig: HostedConfig;
|
2021-01-19 16:31:55 -06:00
|
|
|
}
|
|
|
|
|
2021-01-25 13:56:15 -06:00
|
|
|
export interface AAD {
|
2021-01-19 16:31:55 -06:00
|
|
|
authType: AuthType.AAD;
|
|
|
|
databaseAccount: DatabaseAccount;
|
|
|
|
authorizationToken: string;
|
|
|
|
}
|
|
|
|
|
2021-01-25 13:56:15 -06:00
|
|
|
export interface ConnectionString {
|
2021-01-19 16:31:55 -06:00
|
|
|
authType: AuthType.ConnectionString;
|
|
|
|
// Connection string uses still use encrypted token for Cassandra/Mongo APIs as they us the portal backend proxy
|
|
|
|
encryptedToken: string;
|
|
|
|
encryptedTokenMetadata: AccessInputMetadata;
|
|
|
|
// Master key is currently only used by Graph API. All other APIs use encrypted tokens and proxy with connection string
|
|
|
|
masterKey?: string;
|
|
|
|
}
|
|
|
|
|
2021-01-25 13:56:15 -06:00
|
|
|
export interface EncryptedToken {
|
2021-01-19 16:31:55 -06:00
|
|
|
authType: AuthType.EncryptedToken;
|
|
|
|
encryptedToken: string;
|
|
|
|
encryptedTokenMetadata: AccessInputMetadata;
|
|
|
|
}
|
|
|
|
|
2021-01-25 13:56:15 -06:00
|
|
|
export interface ResourceToken {
|
2021-01-19 16:31:55 -06:00
|
|
|
authType: AuthType.ResourceToken;
|
|
|
|
resourceToken: string;
|
|
|
|
}
|