mirror of
https://github.com/Infisical/infisical.git
synced 2025-03-25 14:05:03 +00:00
Fix frontend endpoints for service tokens and patch secret index.d.ts error
This commit is contained in:
@ -2,7 +2,7 @@ import to from "await-to-js";
|
||||
import { Request, Response } from "express";
|
||||
import mongoose, { Types } from "mongoose";
|
||||
import Secret, { ISecret } from "../../models/secret";
|
||||
import { CreateSecretRequestBody, ModifySecretRequestBody, SanitizedSecretForCreate, SanitizedSecretModify } from "../../types/secret/types";
|
||||
import { CreateSecretRequestBody, ModifySecretRequestBody, SanitizedSecretForCreate, SanitizedSecretModify } from "../../types/secret";
|
||||
const { ValidationError } = mongoose.Error;
|
||||
import { BadRequestError, InternalServerError, UnauthorizedRequestError, ValidationError as RouteValidationError } from '../../utils/errors';
|
||||
import { AnyBulkWriteOperation } from 'mongodb';
|
||||
|
@ -1,25 +0,0 @@
|
||||
import { Log, ILog } from '../models';
|
||||
import * as Sentry from '@sentry/node';
|
||||
import {
|
||||
EVENT_PUSH_SECRETS,
|
||||
EVENT_PULL_SECRETS
|
||||
} from '../variables';
|
||||
|
||||
|
||||
const handleLogHelper = async ({
|
||||
log
|
||||
}: {
|
||||
log: ILog
|
||||
}) => {
|
||||
try {
|
||||
switch (log.event) {
|
||||
case EVENT_PULL_SECRETS:
|
||||
// TODO
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (err){
|
||||
Sentry.setUser(null);
|
||||
Sentry.captureException(err);
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@ import express, { Request, Response } from 'express';
|
||||
import { requireAuth, requireWorkspaceAuth, validateRequest } from '../../middleware';
|
||||
import { body, param, query } from 'express-validator';
|
||||
import { ADMIN, MEMBER } from '../../variables';
|
||||
import { CreateSecretRequestBody, ModifySecretRequestBody } from '../../types/secret/types';
|
||||
import { CreateSecretRequestBody, ModifySecretRequestBody } from '../../types/secret';
|
||||
import { secretController } from '../../controllers/v2';
|
||||
import { fetchAllSecrets } from '../../controllers/v2/secretController';
|
||||
|
||||
|
@ -72,6 +72,8 @@ const AddServiceTokenDialog = ({
|
||||
iv,
|
||||
tag
|
||||
});
|
||||
|
||||
console.log('newServiceToken', newServiceToken);
|
||||
|
||||
setServiceTokens(serviceTokens.concat([newServiceToken.serviceTokenData]));
|
||||
setServiceToken(newServiceToken.serviceToken + "." + randomBytes);
|
||||
|
@ -31,7 +31,7 @@ const addServiceToken = ({
|
||||
iv,
|
||||
tag
|
||||
}: Props) => {
|
||||
return SecurityClient.fetchCall('/api/v2/service-token-data/', {
|
||||
return SecurityClient.fetchCall('/api/v2/service-token/', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -13,7 +13,7 @@ interface Props {
|
||||
const deleteServiceToken = ({
|
||||
serviceTokenId,
|
||||
}: Props) => {
|
||||
return SecurityClient.fetchCall('/api/v2/service-token-data/' + serviceTokenId, {
|
||||
return SecurityClient.fetchCall('/api/v2/service-token/' + serviceTokenId, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
Reference in New Issue
Block a user