Configuration.host is really a URL not a host
还没有人认领这个 Issue。
评估
调研方向
该报告使用了带有 AdminApi->admin_apps_list 的 Configuration,但没有指出源文件或测试。使用值为 URL 的 host 重现该示例,然后跟踪 Configuration 如何构建请求 URL,并验证端点收到的是预期请求,而不是返回 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
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
goauthentik/client-python 的其他 Issue
-
Data returned from the API on StagesApi().stages_invitation_invitations_create() fails validation 未关闭
难度 3/5 1-2 天 新手友好度 45/100
goauthentik/client-python#18 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 45/100
goauthentik/client-python#11 · 2 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 42/100
goauthentik/client-python#10 ·
查看 goauthentik/client-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 80/100
microsoft/magentic-ui#588 ·
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
alexgorbatchev/simple-ptt#3 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
CorrelAid/formtransform#44 ·