Skip to content

Commit 67bda8f

Browse files
authored
Merge branch 'main' into fix/oauth_token_endpoint
2 parents b421765 + 9a33c4a commit 67bda8f

8 files changed

Lines changed: 19 additions & 69 deletions

File tree

.github/workflows/main.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Checkout code
24-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
24+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
2525
with:
2626
fetch-depth: 0
2727

@@ -59,7 +59,7 @@ jobs:
5959

6060
- if: matrix.python-version == '3.10'
6161
name: Upload coverage to Codecov
62-
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
62+
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
6363
continue-on-error: true
6464
with:
6565
token: ${{ secrets.CODECOV_TOKEN }}
@@ -74,7 +74,7 @@ jobs:
7474
id-token: write # Required for PyPI trusted publishing
7575

7676
steps:
77-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
77+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
7878
with:
7979
fetch-depth: 0
8080

@@ -97,15 +97,15 @@ jobs:
9797
python setup.py sdist bdist_wheel
9898
9999
- name: Publish package
100-
uses: pypa/gh-action-pypi-publish@8a08d616893759ef8e1aa1f2785787c0b97e20d6 # v1.10.0
100+
uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3
101101

102102
create-release:
103103
runs-on: ubuntu-latest
104104
if: startsWith(github.ref, 'refs/tags/v')
105105
needs: [publish]
106106

107107
steps:
108-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
108+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
109109
with:
110110
fetch-depth: 0
111111

.github/workflows/semgrep.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
image: returntocorp/semgrep
1212
if: (github.actor != 'dependabot[bot]' && github.actor != 'snyk-bot')
1313
steps:
14-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
14+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
1515
with:
1616
fetch-depth: 0
1717
- run: semgrep ci --no-suppress-errors

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ openfga_sdk/telemetry/counters.py
230230
openfga_sdk/telemetry/histograms.py
231231
openfga_sdk/telemetry/metrics.py
232232
openfga_sdk/telemetry/telemetry.py
233+
openfga_sdk/telemetry/utilities.py
233234
openfga_sdk/validation.py
234235
requirements.txt
235236
setup.cfg
@@ -254,4 +255,5 @@ test/telemetry/counters_test.py
254255
test/telemetry/histograms_test.py
255256
test/telemetry/metrics_test.py
256257
test/telemetry/telemetry_test.py
258+
test/telemetry/utilities_test.py
257259
test/test_open_fga_api.py

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ That repo includes an issue template that will walk through all the places to ch
3333

3434
### Submitting Pull Requests
3535

36-
Considering that the SDKs are autogenerated, please make sure to submit your Pull Requests to the [sdk-generator](https://github.com/openfga/sdk-generator). We will not accept PRs to this repository because they will be overwritten on the next sdk generation.
36+
While we accept Pull Requests on this repository, the SDKs are autogenerated so please consider additionally submitting your Pull Requests to the [sdk-generator](https://github.com/openfga/sdk-generator) and linking the two PRs together and to the corresponding issue. This will greatly assist the OpenFGA team in being able to give timely reviews as well as deploying fixes and updates to our other SDKs as well.
3737

3838
## Getting in touch
3939

@@ -43,4 +43,4 @@ Please do not open issues for general support or usage questions. Instead, join
4343

4444
### Vulnerability Reporting
4545

46-
Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://github.com/openfga/python-sdk/blob/main/.github/SECURITY.md) details the procedure for disclosing security issues.
46+
Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://github.com/openfga/.github/blob/main/SECURITY.md) details the procedure for disclosing security issues.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ If your server is configured with [authentication enabled](https://openfga.dev/d
236236

237237
Get a paginated list of stores.
238238

239-
[API Documentation](https://openfga.dev/api/service/docs/api#/Stores/ListStores)
239+
[API Documentation](https://openfga.dev/api/service#/Stores/ListStores)
240240

241241
```python
242242
# from openfga_sdk.sync import OpenFgaClient
@@ -255,7 +255,7 @@ response = await fga_client.list_stores(options)
255255

256256
Create and initialize a store.
257257

258-
[API Documentation](https://openfga.dev/api/service/docs/api#/Stores/CreateStore)
258+
[API Documentation](https://openfga.dev/api/service#/Stores/CreateStore)
259259

260260
```python
261261
# from openfga_sdk import CreateStoreRequest, OpenFgaClient
@@ -275,7 +275,7 @@ response = await fga_client.create_store(body)
275275

276276
Get information about the current store.
277277

278-
[API Documentation](https://openfga.dev/api/service/docs/api#/Stores/GetStore)
278+
[API Documentation](https://openfga.dev/api/service#/Stores/GetStore)
279279

280280
> Requires a client initialized with a storeId
281281
@@ -294,7 +294,7 @@ response = await fga_client.get_store()
294294

295295
Delete a store.
296296

297-
[API Documentation](https://openfga.dev/api/service/docs/api#/Stores/DeleteStore)
297+
[API Documentation](https://openfga.dev/api/service#/Stores/DeleteStore)
298298

299299
> Requires a client initialized with a storeId
300300
@@ -1154,7 +1154,7 @@ If you have found a bug or if you have a feature request, please report them on
11541154

11551155
### Pull Requests
11561156

1157-
All changes made to this repo will be overwritten on the next generation, so we kindly ask that you send all pull requests related to the SDKs to the [sdk-generator repo](https://github.com/openfga/sdk-generator) instead.
1157+
While we accept Pull Requests on this repository, the SDKs are autogenerated so please consider additionally submitting your Pull Requests to the [sdk-generator](https://github.com/openfga/sdk-generator) and linking the two PRs together and to the corresponding issue. This will greatly assist the OpenFGA team in being able to give timely reviews as well as deploying fixes and updates to our other SDKs as well.
11581158

11591159
## Author
11601160

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.7.1
1+
0.7.2

openfga_sdk/client/client.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ async def list_stores(self, options: dict[str, int | str] = None):
206206
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
207207
"""
208208
# convert options to kwargs
209-
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "ListStores")
210209
kwargs = options_to_kwargs(options)
211210
api_response = await self._api.list_stores(
212211
**kwargs,
@@ -223,7 +222,6 @@ async def create_store(
223222
:param retryParams.maxRetry(options) - Override the max number of retries on each API request
224223
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
225224
"""
226-
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "CreateStore")
227225
kwargs = options_to_kwargs(options)
228226
api_response = await self._api.create_store(body, **kwargs)
229227
return api_response
@@ -236,7 +234,6 @@ async def get_store(self, options: dict[str, int | str] = None):
236234
:param retryParams.maxRetry(options) - Override the max number of retries on each API request
237235
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
238236
"""
239-
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "GetStore")
240237
kwargs = options_to_kwargs(options)
241238
api_response = await self._api.get_store(
242239
**kwargs,
@@ -251,7 +248,6 @@ async def delete_store(self, options: dict[str, int | str] = None):
251248
:param retryParams.maxRetry(options) - Override the max number of retries on each API request
252249
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
253250
"""
254-
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "DeleteStore")
255251
kwargs = options_to_kwargs(options)
256252
api_response = await self._api.delete_store(
257253
**kwargs,
@@ -270,9 +266,6 @@ async def read_authorization_models(self, options: dict[str, int | str] = None):
270266
:param retryParams.maxRetry(options) - Override the max number of retries on each API request
271267
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
272268
"""
273-
options = set_heading_if_not_set(
274-
options, CLIENT_METHOD_HEADER, "ReadAuthorizationModels"
275-
)
276269
kwargs = options_to_kwargs(options)
277270
api_response = await self._api.read_authorization_models(
278271
**kwargs,
@@ -290,9 +283,6 @@ async def write_authorization_model(
290283
:param retryParams.maxRetry(options) - Override the max number of retries on each API request
291284
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
292285
"""
293-
options = set_heading_if_not_set(
294-
options, CLIENT_METHOD_HEADER, "WriteAuthorizationModel"
295-
)
296286
kwargs = options_to_kwargs(options)
297287
api_response = await self._api.write_authorization_model(
298288
body,
@@ -308,9 +298,6 @@ async def read_authorization_model(self, options: dict[str, int | str] = None):
308298
:param retryParams.maxRetry(options) - Override the max number of retries on each API request
309299
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
310300
"""
311-
options = set_heading_if_not_set(
312-
options, CLIENT_METHOD_HEADER, "ReadAuthorizationModel"
313-
)
314301
kwargs = options_to_kwargs(options)
315302
authorization_model_id = self._get_authorization_model_id(options)
316303
api_response = await self._api.read_authorization_model(
@@ -330,7 +317,7 @@ async def read_latest_authorization_model(
330317
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
331318
"""
332319
options = set_heading_if_not_set(
333-
options, CLIENT_METHOD_HEADER, "ReadLatestAuthoriationModel"
320+
options, CLIENT_METHOD_HEADER, "ReadLatestAuthorizationModel"
334321
)
335322
options["page_size"] = 1
336323
api_response = await self.read_authorization_models(options)
@@ -353,7 +340,6 @@ async def read_changes(
353340
:param retryParams.maxRetry(options) - Override the max number of retries on each API request
354341
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
355342
"""
356-
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "ReadChanges")
357343
kwargs = options_to_kwargs(options)
358344
kwargs["type"] = body.type
359345
api_response = await self._api.read_changes(
@@ -373,7 +359,6 @@ async def read(self, body: ReadRequestTupleKey, options: dict[str, str] = None):
373359
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
374360
:param consistency(options) - The type of consistency preferred for the request
375361
"""
376-
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "Read")
377362
page_size = None
378363
continuation_token = None
379364
if options:
@@ -494,7 +479,7 @@ async def write(self, body: ClientWriteRequest, options: dict[str, str] = None):
494479
:param retryParams.maxRetry(options) - Override the max number of retries on each API request
495480
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
496481
"""
497-
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "Writes")
482+
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "Write")
498483
transaction = options_to_transaction_info(options)
499484
if not transaction.disabled:
500485
results = await self._write_with_transaction(body, options)
@@ -561,8 +546,6 @@ async def check(self, body: ClientCheckRequest, options: dict[str, str] = None):
561546
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
562547
:param consistency(options) - The type of consistency preferred for the request
563548
"""
564-
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "Check")
565-
566549
kwargs = options_to_kwargs(options)
567550

568551
req_body = CheckRequest(
@@ -658,7 +641,6 @@ async def expand(self, body: ClientExpandRequest, options: dict[str, str] = None
658641
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
659642
:param consistency(options) - The type of consistency preferred for the request
660643
"""
661-
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "Expand")
662644
kwargs = options_to_kwargs(options)
663645

664646
req_body = ExpandRequest(
@@ -685,7 +667,6 @@ async def list_objects(
685667
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
686668
:param consistency(options) - The type of consistency preferred for the request
687669
"""
688-
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "ListObjects")
689670
kwargs = options_to_kwargs(options)
690671

691672
req_body = ListObjectsRequest(
@@ -750,7 +731,6 @@ async def list_users(
750731
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
751732
:param consistency(options) - The type of consistency preferred for the request
752733
"""
753-
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "ListUsers")
754734
kwargs = options_to_kwargs(options)
755735

756736
req_body = ListUsersRequest(
@@ -784,9 +764,6 @@ async def read_assertions(self, options: dict[str, str] = None):
784764
:param retryParams.maxRetry(options) - Override the max number of retries on each API request
785765
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
786766
"""
787-
options = set_heading_if_not_set(
788-
options, CLIENT_METHOD_HEADER, "ReadAssertions"
789-
)
790767

791768
kwargs = options_to_kwargs(options)
792769
authorization_model_id = self._get_authorization_model_id(options)
@@ -805,9 +782,6 @@ async def write_assertions(
805782
:param retryParams.maxRetry(options) - Override the max number of retries on each API request
806783
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
807784
"""
808-
options = set_heading_if_not_set(
809-
options, CLIENT_METHOD_HEADER, "WriteAssertions"
810-
)
811785
kwargs = options_to_kwargs(options)
812786
authorization_model_id = self._get_authorization_model_id(options)
813787

0 commit comments

Comments
 (0)