Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Configuration.host is really a URL not a host

未關閉
#9 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
python
領域
api

研究方向

該報告使用了帶有 AdminApi->admin_apps_list 的 Configuration,但沒有指出原始檔案或測試。使用值為 URL 的 host 重現該範例,接著追蹤 Configuration 如何建立 request URL,並確認端點收到的是預期的 request,而不是回傳 HTML 404。只有在報告中的 URL 形式具有已定義且可運作的行為時,才算完成。

由索引模型根據 Issue 內容生成。

描述

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).

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: 

<long body here>
主要語言
Mustache
星號
2
分支
1
平均合併
15 小時 5 分鐘
30 天內合併 PR
2

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

goauthentik/client-python 的其他 Issue

查看 goauthentik/client-python 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。