+ {name} |
+
+
+ {(isAllowed) => (
+ handleToggleServiceTokenDataStatus({
+ serviceTokenDataId: _id,
+ isActive: value
+ })}
+ isChecked={isActive}
+ isDisabled={!isAllowed}
+ >
+ {isActive ? "Active" : "Inactive"}
+
+ )}
+
+ |
+
+ {scopes.map((scope) => {
+ let permissionText = "read"
+ if (
+ scope.permissions.includes(Permission.WRITE) &&
+ scope.permissions.includes(Permission.READ)
+ ) {
+ permissionText = "readWrite";
+ }
+
+ return (
+
+
+ {permissionText}
+
+ {` @${scope.environment} - ${scope.secretPath}`}
+
+ );
+ })}
+ |
+
+ {trustedIps.map(({
+ _id: trustedIpId,
+ ipAddress,
+ prefix
+ }) => {
+ return (
+
+ {`${ipAddress}${prefix !== undefined ? `/${prefix}` : ""}`}
+
+ );
+ })}
+ |
+ {accessTokenTTL} |
+ {format(new Date(createdAt), "yyyy-MM-dd")} |
+ {expiresAt ? format(new Date(expiresAt), "yyyy-MM-dd") : "-"} |
+
+
+ {(isAllowed) => (
+ {
+ handlePopUpOpen("serviceTokenV3", {
+ serviceTokenDataId: _id,
+ name,
+ scopes,
+ trustedIps,
+ accessTokenTTL,
+ isRefreshTokenRotationEnabled
+ });
+ }}
+ size="lg"
+ colorSchema="primary"
+ variant="plain"
+ ariaLabel="update"
+ isDisabled={!isAllowed}
+ >
+
+
+ )}
+
+
+ {(isAllowed) => (
+ {
+ handlePopUpOpen("deleteServiceTokenV3", {
+ serviceTokenDataId: _id,
+ name
+ });
+ }}
+ size="lg"
+ colorSchema="danger"
+ variant="plain"
+ ariaLabel="update"
+ className="ml-4"
+ isDisabled={!isAllowed}
+ >
+
+
+ )}
+
+ |
+
+ );
+ })}
+ {!isLoading && data && data?.length === 0 && (
+