Validate Container Registry
Validate that container registry credentials are correct and the registry is accessible before creating or updating a registry configuration.
Endpoint
POST /{companyId}/containerRegistryConfig/validate
Authentication
Required: Yes (Session or Bearer Token with 2FA)
Request Body
{
"url": "myregistry.azurecr.io",
"username": "myusername",
"password": "mypassword"
}
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Registry domain to validate |
username | string | No* | Username for authentication |
password | string | No* | Password or access token |
token | string | No* | Bearer token (alternative to username/password) |
Note: Provide either
username+passwordORtokenfor private registries. For public registries, credentials are optional.
Response
Success Response (200 OK)
Valid Credentials:
{
"valid": true,
"message": "registry validated successfully"
}
Invalid Credentials:
{
"valid": false,
"message": "authentication failed – invalid credentials"
}
Registry Unreachable:
{
"valid": false,
"message": "cannot reach registry"
}
Timeout:
{
"valid": false,
"message": "timeout – registry unreachable"
}
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Missing or invalid URL |
| 401 | Unauthorized - Invalid or missing authentication |
| 500 | Internal Server Error |
Examples
Example 1: Validate Azure Container Registry
curl -X POST "https://api.thevenin.cloud/{companyId}/containerRegistryConfig/validate" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"url": "myregistry.azurecr.io",
"username": "myusername",
"password": "access-token-12345"
}'
Response (Success):
{
"valid": true,
"message": "registry validated successfully"
}
Example 2: Validate GitHub Container Registry
curl -X POST "https://api.thevenin.cloud/{companyId}/containerRegistryConfig/validate" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"url": "ghcr.io",
"username": "myusername",
"password": "ghp_MyGitHubToken123"
}'
Example 3: Invalid Credentials
curl -X POST "https://api.thevenin.cloud/{companyId}/containerRegistryConfig/validate" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"url": "myregistry.azurecr.io",
"username": "wrong",
"password": "invalid"
}'
Response (Failed):
{
"valid": false,
"message": "authentication failed – invalid credentials"
}
Example 4: Unreachable Registry
curl -X POST "https://api.thevenin.cloud/{companyId}/containerRegistryConfig/validate" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"url": "nonexistent-registry.example.com",
"username": "user",
"password": "pass"
}'
Response:
{
"valid": false,
"message": "cannot reach registry"
}
Validation Process
The validation endpoint:
- Normalizes URL: Removes protocols (
https://,http://) and trailing slashes - Handles Docker Hub: Converts
docker.iotoregistry-1.docker.io - Creates Authenticator: From provided credentials (Basic or Bearer)
- Tests Connection: Attempts to ping registry with a test image reference
- Timeout: Maximum 15 seconds for validation
- Returns Result: Success, auth failure, unreachable, or timeout
Common Validation Results
| Result | Meaning | Next Steps |
|---|---|---|
valid: true | Credentials work ✅ | Safe to create registry config |
authentication failed | Wrong credentials ❌ | Check username/password/token |
cannot reach registry | Network/DNS issue ❌ | Verify registry URL |
timeout | Slow/unreachable ⏱️ | Check registry status, try again |
invalid registry URL | Malformed URL ❌ | Fix URL format |