Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
astsiapanay committed Mar 1, 2024
1 parent aa757c8 commit 2824ba9
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 18 deletions.
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Static settings are used on startup and cannot be changed while application is r

### Google Cloud Storage

There are two types of credentials providers supported:
There are two types of credential providers supported:
- User credentials. You can create a service account and authenticate using its private key obtained from Developer console
- Temporary credentials. Application default credentials (ADC)

Expand Down Expand Up @@ -113,6 +113,50 @@ JClouds property `jclouds.oauth.credential-type` should be set `bearerTokenCrede
}
```

### Azure Blob Store

There are two types of credential providers supported:
- User credentials. You can create a service principle and authenticate using its secret from Azure console
- Temporary credentials with Azure AD Workload Identity

#### User credentials

You should set `storage.credential` to service principle secret and `storage.identity` - service principle ID.

The properties to be overridden are below:

```
{
"storage": {
"endpoint": "https://<Azure Blob storage account>.blob.core.windows.net"
"overrides": {
"jclouds.azureblob.auth": "azureAd",
"jclouds.azureblob.tenantId": "<tenant ID>",
"jclouds.azureblob.account: "<Azure Blob storage account>"
}
}
}
```

#### Temporary credentials

You should follow [instructions](https://azure.github.io/azure-workload-identity/docs/) to setup your pod in Azure k8s.
`storage.credential` and `storage.identity` must be unset.

The properties to be overridden are below:

```
{
"storage": {
"endpoint": "https://<Azure Blob storage account>.blob.core.windows.net"
"overrides": {
"jclouds.azureblob.auth": "azureAd",
"jclouds.oauth.credential-type": "bearerTokenCredentials"
}
}
}
```

### Redis
The Redis can be used as a cache with volatile-* eviction policies:
```
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/com/epam/aidial/core/GetToken.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public class AzureCredentialProvider implements CredentialProvider {

private static final long MARGIN_EXPIRATION_IN_SEC = 10;
private static final long EXPIRATION_WINDOW_IN_SEC = 10;

private Credentials credentials;

Expand Down Expand Up @@ -38,7 +38,7 @@ public Credentials getCredentials() {
}

private synchronized Credentials getTemporaryCredentials() {
OffsetDateTime date = OffsetDateTime.now().minusSeconds(MARGIN_EXPIRATION_IN_SEC);
OffsetDateTime date = OffsetDateTime.now().minusSeconds(EXPIRATION_WINDOW_IN_SEC);
if (accessToken == null || date.isAfter(accessToken.getExpiresAt())) {
accessToken = defaultCredential.getTokenSync(tokenRequestContext);
}
Expand Down

0 comments on commit 2824ba9

Please sign in to comment.