两年前,有人问是否可以通过 Gitlab API 以编程方式撤销访问令牌。当时的答案是否定的。我没有找到最近的信息来确认或拒绝这仍然是正确的。
我希望在 Python 的 http 请求库中使用类似的东西:
headers = {'Authorization': clientSecret}
res = gitlab.post("https://gitlab.com/oauth/revoke", headers=headers, data={
'client_id': clientID,
'access_token': accessToken
})
print(res.text)
然而,响应是空的,有不同的变化。