chore: implement instruction compliance remediation
- Replace Go interface{} with any (Go 1.18+ standard)
- Add database indexes to frequently queried model fields
- Add JSDoc documentation to frontend API client methods
- Remove deprecated docker-compose version keys
- Add concurrency groups to all 25 GitHub Actions workflows
- Add YAML front matter and fix H1→H2 headings in docs
Coverage: Backend 85.5%, Frontend 87.73%
Security: No vulnerabilities detected
Refs: docs/plans/instruction_compliance_spec.md
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import client from './client'
|
||||
|
||||
/** CrowdSec Console enrollment status. */
|
||||
export interface ConsoleEnrollmentStatus {
|
||||
status: string
|
||||
tenant?: string
|
||||
@@ -12,6 +13,7 @@ export interface ConsoleEnrollmentStatus {
|
||||
correlation_id?: string
|
||||
}
|
||||
|
||||
/** Payload for enrolling with CrowdSec Console. */
|
||||
export interface ConsoleEnrollPayload {
|
||||
enrollment_key: string
|
||||
tenant?: string
|
||||
@@ -19,16 +21,31 @@ export interface ConsoleEnrollPayload {
|
||||
force?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current CrowdSec Console enrollment status.
|
||||
* @returns Promise resolving to ConsoleEnrollmentStatus
|
||||
* @throws {AxiosError} If status check fails
|
||||
*/
|
||||
export async function getConsoleStatus(): Promise<ConsoleEnrollmentStatus> {
|
||||
const resp = await client.get<ConsoleEnrollmentStatus>('/admin/crowdsec/console/status')
|
||||
return resp.data
|
||||
}
|
||||
|
||||
/**
|
||||
* Enrolls the instance with CrowdSec Console.
|
||||
* @param payload - Enrollment configuration including key and agent name
|
||||
* @returns Promise resolving to the new enrollment status
|
||||
* @throws {AxiosError} If enrollment fails
|
||||
*/
|
||||
export async function enrollConsole(payload: ConsoleEnrollPayload): Promise<ConsoleEnrollmentStatus> {
|
||||
const resp = await client.post<ConsoleEnrollmentStatus>('/admin/crowdsec/console/enroll', payload)
|
||||
return resp.data
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the current CrowdSec Console enrollment.
|
||||
* @throws {AxiosError} If clearing enrollment fails
|
||||
*/
|
||||
export async function clearConsoleEnrollment(): Promise<void> {
|
||||
await client.delete('/admin/crowdsec/console/enrollment')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user