MATIH Platform is in active MVP development. Documentation reflects current implementation status.
8. Platform Services
Credentials

Credentials

The CredentialController and PlatformCredentialService manage cloud provider credentials and service account secrets used by the infrastructure service. Credentials are stored securely in the PlatformCredentialRepository and never exposed in API responses.


Credential Management

Register Credential

Endpoint: POST /api/v1/infrastructure/credentials

curl -X POST http://localhost:8089/api/v1/infrastructure/credentials \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${TOKEN}" \
  -d '{
    "name": "azure-production",
    "provider": "AZURE",
    "credentialType": "SERVICE_PRINCIPAL",
    "description": "Azure production subscription credentials",
    "metadata": {
      "subscriptionId": "sub-12345",
      "tenantId": "aad-tenant-id"
    }
  }'

List Credentials

Endpoint: GET /api/v1/infrastructure/credentials

Returns credential metadata (name, provider, type, status) without exposing secret values.

Get Credential

Endpoint: GET /api/v1/infrastructure/credentials/:credentialId

Update Credential

Endpoint: PUT /api/v1/infrastructure/credentials/:credentialId

Delete Credential

Endpoint: DELETE /api/v1/infrastructure/credentials/:credentialId

Rotate Credential

Endpoint: POST /api/v1/infrastructure/credentials/:credentialId/rotate

Triggers credential rotation, generating new secrets and updating all dependent services.


Credential Types

TypeProviderDescription
SERVICE_PRINCIPALAzureAzure AD service principal with client ID/secret
MANAGED_IDENTITYAzureAzure managed identity (workload identity)
IAM_ROLEAWSAWS IAM role with assume role policy
ACCESS_KEYAWSAWS access key ID and secret
SERVICE_ACCOUNTGCPGCP service account key
WORKLOAD_IDENTITYGCPGCP workload identity federation
KUBECONFIGKubernetesKubernetes cluster credentials
DATABASEDatabaseDatabase connection credentials

PlatformCredential Entity

FieldTypeDescription
idUUIDCredential identifier
nameStringCredential name
providerStringCloud provider
credentialTypeStringType of credential
descriptionStringHuman-readable description
statusStringACTIVE, ROTATING, EXPIRED, REVOKED
expiresAtInstantCredential expiration date
lastRotatedAtInstantLast rotation timestamp
metadataJSONNon-sensitive metadata

Security

Credential secret values are:

  • Stored encrypted in the database
  • Never returned in API responses
  • Accessed only by the infrastructure service internally
  • Rotated on a configurable schedule
  • Audited on every access
⚠️

Credential secrets are stored as Kubernetes secrets and referenced via secretKeyRef in Helm values. They are never hardcoded in configuration files. The PlatformCredentialService retrieves credentials from Kubernetes secrets at runtime.