mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 14:27:23 +00:00
Switch access token tracking to be persistent, add num uses, draft token renewal, update docs
This commit is contained in:
@@ -34,14 +34,14 @@ export const useCreateMachineIdentityClientSecret = () => {
|
||||
machineId,
|
||||
description,
|
||||
ttl,
|
||||
usageLimit
|
||||
numUsesLimit
|
||||
}) => {
|
||||
|
||||
const { data } = await apiRequest.post(`/api/v1/machine-identities/${machineId}/client-secrets`, {
|
||||
machineId,
|
||||
description,
|
||||
ttl,
|
||||
usageLimit
|
||||
numUsesLimit
|
||||
});
|
||||
|
||||
return data;
|
||||
@@ -80,7 +80,8 @@ export const useUpdateMachineIdentity = () => {
|
||||
role,
|
||||
clientSecretTrustedIps,
|
||||
accessTokenTrustedIps,
|
||||
accessTokenTTL
|
||||
accessTokenTTL,
|
||||
accessTokenNumUsesLimit
|
||||
}) => {
|
||||
|
||||
const { data: { machineIdentity } } = await apiRequest.patch(`/api/v1/machine-identities/${machineId}`, {
|
||||
@@ -89,6 +90,7 @@ export const useUpdateMachineIdentity = () => {
|
||||
clientSecretTrustedIps,
|
||||
accessTokenTrustedIps,
|
||||
accessTokenTTL,
|
||||
accessTokenNumUsesLimit
|
||||
});
|
||||
|
||||
return machineIdentity;
|
||||
|
||||
@@ -12,10 +12,9 @@ export type MachineIdentity = {
|
||||
clientId: string;
|
||||
name: string;
|
||||
organization: string;
|
||||
isActive: boolean;
|
||||
accessTokenTTL: number;
|
||||
accessTokenLastUsed?: string;
|
||||
accessTokenUsageCount: number;
|
||||
accessTokenMaxTTL: number;
|
||||
accessTokenNumUsesLimit: number;
|
||||
clientSecretTrustedIps: MachineTrustedIp[];
|
||||
accessTokenTrustedIps: MachineTrustedIp[];
|
||||
createdAt: string;
|
||||
@@ -25,7 +24,6 @@ export type MachineIdentity = {
|
||||
export type MachineIdentityClientSecret = {
|
||||
_id: string;
|
||||
machineIdentity: string;
|
||||
isActive: boolean;
|
||||
description: string;
|
||||
clientSecretPrefix: string;
|
||||
clientSecretNumUses: number;
|
||||
@@ -33,6 +31,7 @@ export type MachineIdentityClientSecret = {
|
||||
clientSecretTTL: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isClientSecretRevoked: boolean;
|
||||
}
|
||||
|
||||
export type MachineMembershipOrg = {
|
||||
@@ -66,13 +65,15 @@ export type CreateMachineIdentityDTO = {
|
||||
ipAddress: string;
|
||||
}[];
|
||||
accessTokenTTL: number;
|
||||
accessTokenMaxTTL: number;
|
||||
accessTokenNumUsesLimit: number;
|
||||
}
|
||||
|
||||
export type CreateMachineIdentityClientSecretDTO = {
|
||||
machineId: string;
|
||||
description?: string;
|
||||
ttl?: number;
|
||||
usageLimit?: number;
|
||||
numUsesLimit?: number;
|
||||
}
|
||||
|
||||
export type CreateMachineIdentityClientSecretRes = {
|
||||
@@ -100,6 +101,8 @@ export type UpdateMachineIdentityDTO = {
|
||||
ipAddress: string;
|
||||
}[];
|
||||
accessTokenTTL?: number;
|
||||
accessTokenMaxTTL?: number;
|
||||
accessTokenNumUsesLimit?: number;
|
||||
}
|
||||
|
||||
export type DeleteMachineIdentityDTO = {
|
||||
|
||||
Reference in New Issue
Block a user