# ValidateAccess validates access to a repository with given parameters

`POST /api/v1/repositories/{repo}/validate`

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  }
]
```

- bearer: apiKey, header Authorization. A token sent as `Authorization: Bearer <token>`. [API Docs](https://sourcey-argocd.pages.dev/developer-guide/api-docs/index.md#authorization) shows how to get one.

Parameters:

- `repo` (path, string, required) - The URL to the repo
  Type: string

- `username` (query, string, optional) - Username for accessing repo.
  Type: string

- `password` (query, string, optional) - Password for accessing repo.
  Type: string

- `sshPrivateKey` (query, string, optional) - Private key data for accessing SSH repository.
  Type: string

- `insecure` (query, boolean, optional) - Whether to skip certificate or host key validation.
  Type: boolean

- `tlsClientCertData` (query, string, optional) - TLS client cert data for accessing HTTPS repository.
  Type: string

- `tlsClientCertKey` (query, string, optional) - TLS client cert key for accessing HTTPS repository.
  Type: string

- `type` (query, string, optional) - The type of the repo.
  Type: string

- `name` (query, string, optional) - The name of the repo.
  Type: string

- `enableOci` (query, boolean, optional) - Whether helm-oci support should be enabled for this repo.
  Type: boolean

- `githubAppPrivateKey` (query, string, optional) - Github App Private Key PEM data.
  Type: string

- `githubAppID` (query, string, int64, optional) - Github App ID of the app used to access the repo.
  Type: string, int64

- `githubAppInstallationID` (query, string, int64, optional) - Github App Installation ID of the installed GitHub App.
  Type: string, int64

- `githubAppEnterpriseBaseUrl` (query, string, optional) - Github App Enterprise base url if empty will default to https://api.github.com.
  Type: string

- `proxy` (query, string, optional) - HTTP/HTTPS proxy to access the repository.
  Type: string

- `project` (query, string, optional) - Reference between project and repository that allow you automatically to be added as item inside SourceRepos project entity.
  Type: string

- `gcpServiceAccountKey` (query, string, optional) - Google Cloud Platform service account key.
  Type: string

- `forceHttpBasicAuth` (query, boolean, optional) - Whether to force HTTP basic auth.
  Type: boolean

- `useAzureWorkloadIdentity` (query, boolean, optional) - Whether to use azure workload identity for authentication.
  Type: boolean

- `bearerToken` (query, string, optional) - BearerToken contains the bearer token used for Git auth at the repo server.
  Type: string

- `insecureOciForceHttp` (query, boolean, optional) - Whether https should be disabled for an OCI repo.
  Type: boolean

- `azureServicePrincipalClientId` (query, string, optional) - Azure Service Principal Client ID.
  Type: string

- `azureServicePrincipalClientSecret` (query, string, optional) - Azure Service Principal Client Secret.
  Type: string

- `azureServicePrincipalTenantId` (query, string, optional) - Azure Service Principal Tenant ID.
  Type: string

- `azureActiveDirectoryEndpoint` (query, string, optional) - Azure Active Directory Endpoint.
  Type: string

Request body: application/json (required)

The URL to the repo

Type: string

Responses:

- 200: A successful response.

Content type: application/json

Type: object

Schema: [repositoryRepoResponse](https://sourcey-argocd.pages.dev/api/models/repositoryreporesponse/index.md)

- default: An unexpected error response.

Content type: application/json

Type: object

Schema: [runtimeError](https://sourcey-argocd.pages.dev/api/models/runtimeerror/index.md)

- `code` (optional)
  Type: integer, int32

- `details` (optional)
  Type: array
  
  Items:
    Reference: [protobufAny](https://sourcey-argocd.pages.dev/api/models/protobufany/index.md); Type: object

- `error` (optional)
  Type: string

- `message` (optional)
  Type: string

## Examples

### cURL

```bash
curl -X POST 'https://argocd.example.com/api/v1/repositories/string/validate' \
  -H 'Authorization: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '"string"'
```

### JavaScript

```javascript
const response = await fetch('https://argocd.example.com/api/v1/repositories/string/validate', {
  method: 'POST',
  headers: {
    'Authorization': 'YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body: '"string"',
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.post(
    'https://argocd.example.com/api/v1/repositories/string/validate',
    data='"string"'.encode('utf-8'),
    headers={
        'Authorization': 'YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
