goauthentik / goauthentik/client-python

Configuration.host is really a URL not a host

Đang mở
#9 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Mustache
Star
2
Fork
1
Merge trung bình
15 giờ 5 phút
Pull request đã merge (30 ngày)
2

Mô tả

I passed `host = 'https://domain.of.my.instance'` to the Configuration object and all I got was a lousy HTML ~~(t-shirt material right there)~~.

```python
import os
import sys
import authentik_client

def main():
host = os.environ.get("AUTHENTIK_HOST")
token = os.environ.get("AUTHENTIK_TOKEN")
if not token:
print("AUTHENTIK_TOKEN unset")
sys.exit(1)

if not host:
print("AUTHENTIK_HOST unset")
sys.exit(1)

configuration = authentik_client.Configuration(
host=host,
access_token=token
)

with authentik_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = authentik_client.AdminApi(api_client)
try:
api_response = api_instance.admin_apps_list()
print("The response of AdminApi->admin_apps_list:\n")
print(api_response)
except authentik_client.ApiException as e:
print("Exception when calling AdminApi->admin_apps_list: %s\n" % e)

if __name__ == "__main__":
main()
```

When invoking it I got:

```
python move-okta-app-to-authentik.py
Exception when calling AdminApi->admin_apps_list: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'date': 'Thu, 30 Oct 2025 20:43:11 GMT', 'content-type': 'text/html; charset=utf-8', 'content-length': '6743', 'referrer-policy': 'same-origin', 'vary': 'Accept-Encoding, Cookie', 'x-authentik-id': 'eb6d60959c6042fbb4fd3c60bfdc5284', 'x-content-type-options': 'nosniff', 'x-frame-options': 'DENY', 'x-powered-by': 'authentik', 'strict-transport-security': 'max-age=31536000; includeSubDomains'})
HTTP response body:

```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.