Branch: refs/heads/master
Home:
https://github.com/Checkmk/checkmk
Commit: 046f5e1c20cafd3408238761aac69f1396b08b4e
https://github.com/Checkmk/checkmk/commit/046f5e1c20cafd3408238761aac69f139…
Author: Leonardo Petrora <leonardo.petrora(a)checkmk.com>
Date: 2024-09-03 (Tue, 03 Sep 2024)
Changed paths:
M cmk/gui/openapi/restful_objects/decorators.py
M cmk/gui/openapi/restful_objects/type_defs.py
M cmk/gui/wsgi/applications/rest_api.py
M tests/unit/cmk/gui/openapi/test_endpoint.py
Log Message:
-----------
Introduce Rest API endpoints only for Checkmk site
Due to the SaaS platform, it is required that certain endpoints cannot
be accessed by users. To achieve this, the following changes are
introduced:
* The `internal_user_only` attribute is added to the Endpoint decorator.
When `internal_user_only = True`, then this endpoint can only be
accessed using the InternalToken (Site secret) authentication method.
* The `tag_group` `Undocumented Endpoint` is added. When
`tag_group = "Undocumented Endpoint"` then the endpoint will not be
included in the Rest API documentation.
Example:
```
@Endpoint(
path="/i_am_reserved",
method="get",
link_relation="help",
tag_group="Undocumented Endpoint", # Excluded from API docs
internal_user_only = True, # Only available for InternalToken
output_empty=True,
)
def test (param):
return Response(status=204)
```
CMK-18741
Change-Id: I97c7dca1696099daeb90abf782161f6e14541478
To unsubscribe from these emails, change your notification settings at
https://github.com/Checkmk/checkmk/settings/notifications