6 Commits

Author SHA1 Message Date
8f24bb3cc1 Simplified code to demonstrate issue with comma 2023-09-07 08:45:43 -04:00
fe8ea62a98 Merge pull request #6 from enxoco/features/akeyless-encryption
Added akeyless api integration
2023-08-31 21:18:31 -04:00
3b7f4d025d Merge pull request #5 from enxoco/features/docker
Added docker config
2023-08-31 21:18:14 -04:00
80737a2927 Added akeyless api integration 2023-08-31 17:14:13 -04:00
e0d4cb41b0 Added docker config 2023-08-31 16:17:56 -04:00
c1b9a1fa41 Merge pull request #4 from enxoco/features/toast
Added toast and copy to clipboard functionality
2023-08-27 20:27:01 -04:00
12 changed files with 71 additions and 21 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
node_modules/*

3
.env.example Normal file
View File

@ -0,0 +1,3 @@
VITE_AKEYLESS_ACCESS_ID=""
VITE_AKEYLESS_ACCESS_KEY=""
VITE_AKEYLESS_KEY_PATH=""

2
.gitignore vendored
View File

@ -22,4 +22,4 @@ dist-ssr
*.njsproj
*.sln
*.sw?
tokens.ts
.env

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM node:18 AS Build
WORKDIR /app/node/
COPY . .
RUN yarn
RUN yarn build
FROM nginx AS Production
WORKDIR /usr/share/nginx/html
COPY --from=Build /app/node/dist /usr/share/nginx/html/

View File

@ -2,7 +2,4 @@ import "./style.css";
import { tokenList } from "./tokenList";
import rootDiv from "./utils/root";
rootDiv!.innerHTML = `
${tokenList()}
`;
rootDiv!.innerHTML = await tokenList();

View File

@ -2,6 +2,11 @@ export function toast(element: HTMLDivElement, message: string) {
// Target our predefined DIV that will hold toast messages.
const toastDiv = element.getElementsByClassName('toast')
const interval = setInterval(() => {
toastDiv[0].remove()
clearInterval(interval)
}, 5000)
// If we currently have a toast displayed, let's remove it from the DOM.
if (toastDiv && toastDiv.length != 0) {
for (const el of toastDiv){

View File

@ -1,8 +1,7 @@
import totp from 'totp-generator'
const period = 30
const digits = 6
export function displayToken(secret) {
export function displayToken(secret: string) {
const token = totp(secret.replace(/ /g, '').trim(), {
digits,
period,

View File

@ -1,8 +1,9 @@
import { displayTokenListItem } from "./TokenListItem";
import { displayTokenListItem } from "./tokenListItem";
import { tokens } from "./tokens";
export function tokenList() {
return `<form id="tokens">${tokens.map((token) =>
import { Token } from "./utils/types";
console.log('tokens', tokens)
export async function tokenList() {
return `<form id="tokens">${tokens.map((token: Token) =>
displayTokenListItem(token.account, token.secret)
)}</form>`;
}

View File

@ -1,10 +0,0 @@
export const tokens = [
{
account: 'Github',
secret: 'AFDAFDAFAFFD',
},
{
account: 'Gmail',
secret: 'AFDJKADFJsddfsKLAFSJLK',
},
]

10
src/tokens.ts Normal file
View File

@ -0,0 +1,10 @@
export const tokens = [
{
"account": "Github",
"secret": "AFDAFDAFAFFD"
},
{
"account": "Gmail",
"secret": "AFDJKADFJsddfsKLAFSJLK"
}
]

15
src/utils/types.ts Normal file
View File

@ -0,0 +1,15 @@
import { tokens } from "../tokens";
export interface TokenResponse {
token: string;
creds: null;
}
export interface Token {
account: string;
secret: string;
}
export interface GenericAPIResponse {
result: string;
}

20
tsconfig.json Normal file
View File

@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"types": [],
"allowJs": false,
"skipLibCheck": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": ["src"]
}