Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
fix: update return types on 204 no content
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamzeh committed Mar 10, 2022
1 parent 501ca15 commit 1e379ba
Show file tree
Hide file tree
Showing 11 changed files with 226 additions and 83 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/build-and-test.yaml

This file was deleted.

83 changes: 83 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build, Test and Release

on:
push:
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/dotnet@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: src/Com.Auth0.FGA/

- uses: actions/upload-artifact@v2
with:
name: nuget-package
path: src/Com.Auth0.FGA/bin/Release/Com.Auth0.FGA.*.nupkg

publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: test

steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
source-url: https://nuget.pkg.github.com/auth0-lab/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --configuration Release

- uses: actions/upload-artifact@v2
with:
name: nuget-package
path: src/Com.Auth0.FGA/bin/Release/Com.Auth0.FGA.*.nupkg

- name: Publish
run: dotnet nuget push src/Com.Auth0.FGA/bin/Release/Com.Auth0.FGA.$($env:GITHUB_REF -replace "refs/tags/v").nupkg

create-release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: publish

steps:
- uses: actions/checkout@v2

- uses: Roang-zero1/github-create-release-action@5cf058ddffa6fa04e5cda07c98570c757dc4a0e1
with:
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.github/ISSUE_TEMPLATES/feature_request.md
.github/PULL_REQUEST_TEMPLATE.md
.github/SECURITY.md
.github/workflows/build-and-test.yaml
.github/workflows/main.yaml
.github/workflows/semgrep.yaml
.gitignore
CHANGELOG.md
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.1.0 (2022-02-09)
## v0.1.1

### [0.1.1](https://github.com/auth0-lab/fga-dotnet-sdk/compare/v0.1.0...v0.1.1) (2022-03-09)

#### Changes
- fix: fix for return types on 204 no content

## v0.1.1

### 0.1.0 (2022-03-07)

#### Changes
Initial Release
31 changes: 6 additions & 25 deletions docs/Auth0FgaApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,12 @@ Name | Type | Description | Notes
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

<a name="deletetokenissuer"></a>
# **DeleteTokenIssuer**
> Object DeleteTokenIssuer (string id)
> void DeleteTokenIssuer (string id)
Remove 3rd party token issuer for Auth0 FGA read and write operations

Expand Down Expand Up @@ -138,8 +137,7 @@ namespace Example
try
{
// Remove 3rd party token issuer for Auth0 FGA read and write operations
Object response = await auth0FgaApi.DeleteTokenIssuer(id);
Debug.WriteLine(response);
auth0FgaApi.DeleteTokenIssuer(id);
}
catch (ApiException e)
{
Expand All @@ -161,7 +159,7 @@ Name | Type | Description | Notes

### Return type

**Object**
void (empty response body)

### HTTP request headers

Expand All @@ -172,15 +170,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | A successful response. | - |
| **204** | A successful response. | - |
| **400** | Request failed due to invalid input. | - |
| **401** | Request failed due to authentication errors. | - |
| **403** | Request failed due to forbidden permission. | - |
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -262,7 +258,6 @@ Name | Type | Description | Notes
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -344,7 +339,6 @@ Name | Type | Description | Notes
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -426,7 +420,6 @@ Name | Type | Description | Notes
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -508,7 +501,6 @@ Name | Type | Description | Notes
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -592,7 +584,6 @@ Name | Type | Description | Notes
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -672,7 +663,6 @@ Name | Type | Description | Notes
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -754,13 +744,12 @@ Name | Type | Description | Notes
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

<a name="writeassertions"></a>
# **WriteAssertions**
> Object WriteAssertions (string authorizationModelId, WriteAssertionsRequestParams body)
> void WriteAssertions (string authorizationModelId, WriteAssertionsRequestParams body)
Upsert assertions for an authorization model ID

Expand Down Expand Up @@ -796,8 +785,7 @@ namespace Example
try
{
// Upsert assertions for an authorization model ID
Object response = await auth0FgaApi.WriteAssertions(authorizationModelId, body);
Debug.WriteLine(response);
auth0FgaApi.WriteAssertions(authorizationModelId, body);
}
catch (ApiException e)
{
Expand All @@ -820,7 +808,7 @@ Name | Type | Description | Notes

### Return type

**Object**
void (empty response body)

### HTTP request headers

Expand All @@ -831,15 +819,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | A successful response. | - |
| **204** | A successful response. | - |
| **400** | Request failed due to invalid input. | - |
| **401** | Request failed due to authentication errors. | - |
| **403** | Request failed due to forbidden permission. | - |
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -914,15 +900,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | A successful response. | - |
| **201** | A successful response. | - |
| **400** | Request failed due to invalid input. | - |
| **401** | Request failed due to authentication errors. | - |
| **403** | Request failed due to forbidden permission. | - |
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -1004,7 +988,6 @@ Name | Type | Description | Notes
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -1079,15 +1062,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | A successful response. | - |
| **201** | A successful response. | - |
| **400** | Request failed due to invalid input. | - |
| **401** | Request failed due to authentication errors. | - |
| **403** | Request failed due to forbidden permission. | - |
| **404** | Request failed due to incorrect path. | - |
| **429** | Request failed due to too many requests. | - |
| **500** | Request failed due to internal server error. | - |
| **0** | An unexpected error response. | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

10 changes: 4 additions & 6 deletions src/Com.Auth0.FGA.Test/Api/Auth0FgaApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,7 @@ public async Task WriteAssertionsTest() {
ItExpr.IsAny<CancellationToken>()
)
.ReturnsAsync(new HttpResponseMessage() {
StatusCode = HttpStatusCode.OK,
Content = Utils.CreateJsonStringContent(new Object()),
StatusCode = HttpStatusCode.NoContent,
});

var httpClient = new HttpClient(mockHandler.Object);
Expand All @@ -811,7 +810,7 @@ public async Task WriteAssertionsTest() {
var body = new WriteAssertionsRequestParams(assertions: new List<Assertion>() {
new(new TupleKey("repo:auth0/express-jwt", "reader", "anne"), true)
});
var response = await auth0FgaApi.WriteAssertions(authorizationModelId, body);
await auth0FgaApi.WriteAssertions(authorizationModelId, body);

mockHandler.Protected().Verify(
"SendAsync",
Expand Down Expand Up @@ -1010,14 +1009,13 @@ public async Task DeleteTokenIssuerTest() {
ItExpr.IsAny<CancellationToken>()
)
.ReturnsAsync(new HttpResponseMessage() {
StatusCode = HttpStatusCode.OK,
Content = Utils.CreateJsonStringContent(new Object()),
StatusCode = HttpStatusCode.NoContent,
});

var httpClient = new HttpClient(mockHandler.Object);
var auth0FgaApi = new Auth0FgaApi(_config, httpClient);

var response = await auth0FgaApi.DeleteTokenIssuer(issuerId);
await auth0FgaApi.DeleteTokenIssuer(issuerId);

mockHandler.Protected().Verify(
"SendAsync",
Expand Down
Loading

0 comments on commit 1e379ba

Please sign in to comment.