Skip to content

Commit

Permalink
Add APS_CLIENT_ID, APS_CLIENT_SECRET to the Configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Dec 13, 2024
1 parent 8756316 commit ed4a3b7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Autodesk.Forge.Oss/Autodesk.Forge.Oss.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<PropertyGroup>
<PackageId>ricaun.Autodesk.Forge.Oss</PackageId>
<Version>2.1.0-beta</Version>
<Version>2.1.0-rc</Version>
<ProjectGuid>{54AC7247-0A9C-4A56-835B-D1790800647B}</ProjectGuid>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions Autodesk.Forge.Oss/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ private Bearer GetBearer()
/// <returns></returns>
private async Task<Bearer> GetBearerAsync()
{
string clientId = ClientId ?? Environment.GetEnvironmentVariable("FORGE_CLIENT_ID");
string clientSecret = ClientSecret ?? Environment.GetEnvironmentVariable("FORGE_CLIENT_SECRET");
string clientId = ClientId ?? Environment.GetEnvironmentVariable("APS_CLIENT_ID") ?? Environment.GetEnvironmentVariable("FORGE_CLIENT_ID");
string clientSecret = ClientSecret ?? Environment.GetEnvironmentVariable("APS_CLIENT_SECRET") ?? Environment.GetEnvironmentVariable("FORGE_CLIENT_SECRET");

if (string.IsNullOrEmpty(clientId))
throw new Exception("'clientId' parameter is null or empty.");
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Updated
- Remove obsolete endpoints and use `S3`.
- Update `UploadFileAsync` to support multi-part upload.
- Add `APS_CLIENT_ID`, `APS_CLIENT_SECRET` to the `Configuration`.

## [2.0.0] / 2024-08-20
### Features
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@

By default the Forge credentials could be defined with the following environment variables:

```bash
APS_CLIENT_ID=<your client id>
APS_CLIENT_SECRET=<your client secret>
```

or

```bash
FORGE_CLIENT_ID=<your client id>
FORGE_CLIENT_SECRET=<your client secret>
Expand Down Expand Up @@ -77,8 +84,8 @@ BucketObjects bucketObjects = await ossClient.GetObjectsAsync(bucketKey);
Stream stream = await ossClient.GetObjectAsync(bucketKey, objectName);
ObjectDetails objectDetails = await ossClient.GetObjectDetailsAsync(bucketKey, objectName);
ObjectDetails objectDetails = await ossClient.UploadObjectAsync(bucketKey, objectName);
ObjectDetails objectDetails = await ossClient.UploadChunkAsync(bucketKey, objectName);
ObjectDetails objectDetails = await ossClient.CopyToAsync(bucketKey, objectName, newObjectName);
ObjectDetails objectDetails = await ossClient.GetS3UploadURLAsync(bucketKey, objectName);
ObjectDetails objectDetails = await ossClient.CompleteS3UploadAsync(bucketKey, objectName, uploadKey);
await ossClient.DeleteObjectAsync(bucketKey, objectName);
```

Expand Down

0 comments on commit ed4a3b7

Please sign in to comment.