Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update documentation and ci #34

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: Report an issue
about: Create a bug report about an existing issue.
title: ''
labels: 'bug'
assignees: ''

---

**Please do not report security vulnerabilities here**. See the [Responsible Disclosure Program](https://github.com/openfga/dotnet-sdk/blob/main/.github/SECURITY.md).

**Thank you in advance for helping us to improve this library!** Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible.

By submitting an issue to this repository, you agree to the terms within the [OpenFGA Code of Conduct](https://github.com/openfga/rfcs/blob/main/CODE-OF-CONDUCT.md).

### Description

> Provide a clear and concise description of the issue, including what you expected to happen.

### Version of SDK

> v0.2.0

### Version of OpenFGA (if known)

> v1.1.0

### OpenFGA Flags/Custom Configuration Applicable

> environment:
> - OPENFGA_DATASTORE_ENGINE=postgres
> - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable
> - OPENFGA_TRACE_ENABLED=true
> - OPENFGA_TRACE_SAMPLE_RATIO=1
> - OPENFGA_TRACE_OTLP_ENDPOINT=otel-collector:4317
> - OPENFGA_METRICS_ENABLE_RPC_HISTOGRAMS=true

### Reproduction

> Detail the steps taken to reproduce this error, what was expected, and whether this issue can be reproduced consistently or if it is intermittent.
>
> 1. Initialize OpenFgaClient with openfga_sdk.ClientConfiguration parameter api_host=127.0.0.1, credentials method client_credentials
> 2. Invoke method read_authorization_models
> 3. See exception thrown

### Sample Code the Produces Issues

>
> ```
> <code snippet>
> ```

### Backtrace (if applicable)

> ```
> <backtrace>
> ```


### Expected behavior
> A clear and concise description of what you expected to happen.

### Additional context
> Add any other context about the problem here.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Feature request
about: Suggest new functionality for this project.
title: ''
labels: 'feature'
assignees: ''

---

**Please do not report security vulnerabilities here**. See the [Responsible Disclosure Program](https://github.com/openfga/dotnet-sdk/blob/main/.github/SECURITY.md).

**Thank you in advance for helping us to improve this library!** Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible.

By submitting an issue to this repository, you agree to the terms within the [OpenFGA Code of Conduct](https://github.com/openfga/rfcs/blob/main/CODE-OF-CONDUCT.md).

### Describe the problem you'd like to have solved

> A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

### Describe the ideal solution

> A clear and concise description of what you want to happen.

## Alternatives and current workarounds

> A clear and concise description of any alternatives you've considered or any workarounds that are currently in place.

### Additional context

> Add any other context or screenshots about the feature request here.
21 changes: 14 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build, Test and Release

on:
merge_group:
push:
pull_request:
workflow_dispatch:
Expand All @@ -10,10 +11,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

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

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

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
with:
name: nuget-package
path: src/OpenFga.Sdk/bin/Release/OpenFga.Sdk.*.nupkg
Expand All @@ -37,10 +40,12 @@ jobs:
needs: [test]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

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

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
with:
name: nuget-package
path: src/OpenFga.Sdk/bin/Release/OpenFga.Sdk.*.nupkg
Expand All @@ -69,7 +74,9 @@ jobs:
needs: publish

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- uses: Roang-zero1/github-create-release-action@5cf058ddffa6fa04e5cda07c98570c757dc4a0e1
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/semgrep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
image: returntocorp/semgrep
if: (github.actor != 'dependabot[bot]' && github.actor != 'snyk-bot')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- run: semgrep ci
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
4 changes: 2 additions & 2 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.editorconfig
.fossa.yml
.github/CODEOWNERS
.github/ISSUE_TEMPLATES/bug_report.md
.github/ISSUE_TEMPLATES/feature_request.md
.github/ISSUE_TEMPLATE/bug_report.md
.github/ISSUE_TEMPLATE/feature_request.md
.github/workflows/main.yaml
.github/workflows/semgrep.yaml
.gitignore
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Release](https://img.shields.io/github/v/release/openfga/dotnet-sdk?sort=semver&color=green)](https://github.com/openfga/dotnet-sdk/releases)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](./LICENSE)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fopenfga%2Fdotnet-sdk.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenfga%2Fdotnet-sdk?ref=badge_shield)
[![Discord Server](https://img.shields.io/discord/759188666072825867?color=7289da&logo=discord "Discord Server")](https://discord.com/channels/759188666072825867/930524706854031421)
[![Discord Server](https://img.shields.io/discord/759188666072825867?color=7289da&logo=discord "Discord Server")](https://discord.gg/8naAwJfWN6)
[![Twitter](https://img.shields.io/twitter/follow/openfga?color=%23179CF0&logo=twitter&style=flat-square "@openfga on Twitter")](https://twitter.com/openfga)

This is an autogenerated SDK for OpenFGA. It provides a wrapper around the [OpenFGA API definition](https://openfga.dev/api).
Expand Down Expand Up @@ -534,9 +534,9 @@ var options = new ClientCheckOptions {
AuthorizationModelId = "01GXSA8YR785C4FYS3C0RTG7B1",
};
var body = new ClientCheckRequest {
Object = "document:roadmap",
User = "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
Relation = "writer",
User = "user:81684243-9356-4421-8fbf-a4f8d36aa31b"
Object = "document:roadmap"
};
var response = await fgaClient.Check(body, options);
// response.Allowed = true
Expand Down Expand Up @@ -656,7 +656,7 @@ var response = await fgaClient.Expand(body, options);
// response.Tree.Root = {"name":"document:roadmap#viewer","leaf":{"users":{"users":["user:81684243-9356-4421-8fbf-a4f8d36aa31b","user:f52a4f7a-054d-47ff-bb6e-3ac81269988f"]}}}
```

#### List Objects
##### List Objects

List the objects of a particular type a user has access to.

Expand Down Expand Up @@ -684,7 +684,7 @@ var response = await fgaClient.ListObjects(body, options);
// response.Objects = ["document:roadmap"]
```

#### List Relations
##### List Relations

List the relations a user has on an object.

Expand All @@ -707,9 +707,9 @@ var response = await fgaClient.ListRelations(body);
// response.Relations = ["can_view", "can_edit"]
```

### Assertions
#### Assertions

#### Read Assertions
##### Read Assertions

Read assertions for a particular authorization model.

Expand All @@ -723,7 +723,7 @@ var options = new ClientReadAssertionsOptions {
var response = await fgaClient.ReadAssertions(options);
```

#### Write Assertions
##### Write Assertions

Update the assertions for a particular authorization model.

Expand Down Expand Up @@ -753,7 +753,7 @@ await fgaClient.WriteAssertions(body, options);
| [**DeleteStore**](docs/OpenFgaApi.md#deletestore) | **DELETE** /stores/{store_id} | Delete a store |
| [**Expand**](docs/OpenFgaApi.md#expand) | **POST** /stores/{store_id}/expand | Expand all relationships in userset tree format, and following userset rewrite rules. Useful to reason about and debug a certain relationship |
| [**GetStore**](docs/OpenFgaApi.md#getstore) | **GET** /stores/{store_id} | Get a store |
| [**ListObjects**](docs/OpenFgaApi.md#listobjects) | **POST** /stores/{store_id}/list-objects | Get all objects of the given type that the user has a relation with |
| [**ListObjects**](docs/OpenFgaApi.md#listobjects) | **POST** /stores/{store_id}/list-objects | List all objects of the given type that the user has a relation with |
| [**ListStores**](docs/OpenFgaApi.md#liststores) | **GET** /stores | List all stores |
| [**Read**](docs/OpenFgaApi.md#read) | **POST** /stores/{store_id}/read | Get tuples from the store that matches a query, without following userset rewrite rules |
| [**ReadAssertions**](docs/OpenFgaApi.md#readassertions) | **GET** /stores/{store_id}/assertions/{authorization_model_id} | Read assertions for an authorization model ID |
Expand Down
2 changes: 1 addition & 1 deletion docs/ListStoresResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Stores** | [**List&lt;Store&gt;**](Store.md) | | [optional]
**ContinuationToken** | **string** | | [optional]
**ContinuationToken** | **string** | The continuation token will be empty if there are no more stores. | [optional]

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

Loading
Loading