mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 00:52:09 +00:00
improvements: address feedback
This commit is contained in:
@@ -1,22 +1,29 @@
|
||||
import { faGithub, IconDefinition } from "@fortawesome/free-brands-svg-icons";
|
||||
import { faGithub } from "@fortawesome/free-brands-svg-icons";
|
||||
import { faKey, faPassport, faUser } from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
import { AppConnection } from "@app/hooks/api/appConnections/enums";
|
||||
import { TAppConnection } from "@app/hooks/api/appConnections/types";
|
||||
import { AwsConnectionMethod } from "@app/hooks/api/appConnections/types/aws-connection";
|
||||
import { GitHubConnectionMethod } from "@app/hooks/api/appConnections/types/github-connection";
|
||||
import {
|
||||
AwsConnectionMethod,
|
||||
GitHubConnectionMethod,
|
||||
TAppConnection
|
||||
} from "@app/hooks/api/appConnections/types";
|
||||
|
||||
export const APP_CONNECTION_MAP: Record<AppConnection, { name: string; image: string }> = {
|
||||
[AppConnection.AWS]: { name: "AWS", image: "Amazon Web Services.png" },
|
||||
[AppConnection.GitHub]: { name: "GitHub", image: "GitHub.png" }
|
||||
};
|
||||
|
||||
export const APP_CONNECTION_METHOD_MAP: Record<
|
||||
TAppConnection["method"],
|
||||
{ name: string; icon: IconDefinition }
|
||||
> = {
|
||||
[AwsConnectionMethod.AssumeRole]: { name: "Assume Role", icon: faUser },
|
||||
[AwsConnectionMethod.AccessKey]: { name: "Access Key", icon: faKey },
|
||||
[GitHubConnectionMethod.App]: { name: "GitHub App", icon: faGithub },
|
||||
[GitHubConnectionMethod.OAuth]: { name: "OAuth", icon: faPassport }
|
||||
export const getAppConnectionMethodDetails = (method: TAppConnection["method"]) => {
|
||||
switch (method) {
|
||||
case GitHubConnectionMethod.App:
|
||||
return { name: "GitHub App", icon: faGithub };
|
||||
case GitHubConnectionMethod.OAuth:
|
||||
return { name: "OAuth", icon: faPassport };
|
||||
case AwsConnectionMethod.AccessKey:
|
||||
return { name: "Access Key", icon: faKey };
|
||||
case AwsConnectionMethod.AssumeRole:
|
||||
return { name: "Assume Role", icon: faUser };
|
||||
default:
|
||||
throw new Error(`Unhandled App Connection Method: ${method}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export const isInfisicalCloud = () =>
|
||||
window.location.origin.includes("https://app.infisical.com") ||
|
||||
window.location.origin.includes("https://us.infisical.com") ||
|
||||
window.location.origin.includes("https://eu.infisical.com");
|
||||
Reference in New Issue
Block a user