Skip to content

Commit

Permalink
Fix JS example with credentials, sync JS and dotnet dependency updates (
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris authored Feb 12, 2024
2 parents 77f822b + b0b3b2c commit f1c2b1f
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
with:
dotnet-version: 6.0.x

Expand All @@ -30,7 +30,7 @@ jobs:
- name: Test
run: dotnet test --no-build --verbosity normal

- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
with:
name: nuget-package
path: src/<%packageName%>/bin/Release/<%packageName%>.*.nupkg
Expand All @@ -46,7 +46,7 @@ jobs:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
with:
dotnet-version: 6.0.x
source-url: https://api.nuget.org/v3/index.json
Expand All @@ -59,7 +59,7 @@ jobs:
- name: Build
run: dotnet build --no-restore --configuration Release

- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
with:
name: nuget-package
path: src/<%packageName%>/bin/Release/<%packageName%>.*.nupkg
Expand All @@ -79,7 +79,7 @@ jobs:
with:
fetch-depth: 0

- uses: Roang-zero1/github-create-release-action@5cf058ddffa6fa04e5cda07c98570c757dc4a0e1
- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803
with:
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
env:
Expand Down
4 changes: 2 additions & 2 deletions config/clients/dotnet/template/netcore_testproject.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"><PrivateAssets>all</PrivateAssets></PackageReference>
<PackageReference Include="Moq" Version="4.20.70"><PrivateAssets>all</PrivateAssets></PackageReference>
<PackageReference Include="xunit" Version="2.6.3"><PrivateAssets>all</PrivateAssets></PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="xunit" Version="2.6.6"><PrivateAssets>all</PrivateAssets></PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions config/clients/js/template/example/example1/example1.mjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Credentials, CredentialsMethod, FgaApiValidationError, OpenFgaClient, TypeName } from "@openfga/sdk";
import { CredentialsMethod, FgaApiValidationError, OpenFgaClient, TypeName } from "@openfga/sdk";

async function main () {
let credentials;
if (process.env.FGA_CLIENT_ID) {
credentials = new Credentials({
credentials = {
method: CredentialsMethod.ClientCredentials,
config: {
clientId: process.env.FGA_CLIENT_ID,
clientSecret: process.env.FGA_CLIENT_SECRET,
apiAudience: process.env.FGA_API_AUDIENCE,
apiTokenIssuer: process.env.FGA_API_TOKEN_ISSUER
}
});
};
}

const fgaClient = new OpenFgaClient({
Expand Down
Loading

0 comments on commit f1c2b1f

Please sign in to comment.