Контекст:
в рамках какого-то проекта я должен получить все детали MR (структура каталогов / +1s / разрешение комментариев / и т. д.). Это также должно быть объединено позже на основе определенных условий.
Все это делается через стороннее приложение, которое будет иметь доступ к ветке гитлаба, в которой будет поднят MR
Проблемная зона
Проходя документация по API, я пытаюсь получить MR, но каждый раз, когда я нажимаю страницу аутентификации входа (даже после добавления Токен личного доступа)
In [14]: url_value
Out[14]: "https://gitlab.our_custom_domain.com/projects/frontend-services/major_repo/merge_requests/11/?private_token='DcpikqosHCyZAstyzXBQ'"
In [15]: requests.get(url_value).text
Out[15]: '<!DOCTYPE html>\n<html class = "devise-layout-html">\n<head prefix = "og: http://ogp.me/ns#">\n<meta charset = "utf-8">\n<meta content = "IE=edge" http-equiv = "X-UA-Compatible">\n<meta content = "object" property = "og:type">\n<meta content = "GitLab" property = "og:site_name">\n<meta content = "Sign in" property = "og:title">\n<meta content = "GitLab Community Edition" property = "og:description">\n<meta content = "https://gitlab.our_custom_domain.com/assets/gitlab_logo-7ae504fe4f68fdebb3c2034e36621930cd36ea87924c11ff65dbcb8ed50dca58.png" property = "og:image">\n<meta content = "64" property = "og:image:width">\n<meta content = "64" property = "og:image:height">\n<meta content = "https://gitlab.our_custom_domain.com/users/sign_in" property = "og:url">\n<meta content = "summary" property = "twitter:card">\n<meta content = "Sign in" property = "twitter:title">\n<meta content = "GitLab Community Edition" property = "twitter:description">\n<meta content = "https://gitlab.our_custom_domain.com/assets/gitlab_logo-7ae504fe4f68fdebb3c2034e36621930cd36ea87924c11ff65dbcb8ed50dca58.png" property = "twitter:image">\n\n<title>Sign in · GitLab</title>\n<meta content = "GitLab Community Edition" name = "description">\n<link rel = "shortcut icon" type = "image/png" href = "/assets/favicon-7901bd695fb93edb07975966062049829afb56cf11511236e61bcf425070e36e.png" id = "favicon" data-original-href = "/assets/favicon-7901bd695fb93edb07975966062049829afb56cf11511236e61bcf425070e36e.png" />\n<link rel = "stylesheet" media = "all" href = "/assets/application-3699df5421217cf3678b3fccba46be0eb9ba5f72488c2eece3cf7ee2e8e8b284.css" />\n<link rel = "stylesheet" media = "print" href = "/assets/print-c8ff536271f8974b8a9a5f75c0ca25d2b8c1dceb4cff3c01d1603862a0bdcbfc.css" />\n\n\n<script>\n//<




Как указано в GitLab API
You can use a personal access token to authenticate with the API by passing it in either the
private_tokenparameter or thePrivate-Tokenheader.Example of using the personal access token in a parameter:
curl https://gitlab.example.com/api/v4/projects?private_token=<your_access_token>Example of using the personal access token in a header:
curl --header "Private-Token: <your_access_token>" https://gitlab.example.com/api/v4/projects
В твоем случае:
merge_requests/11/?private_token='DcpikqosHCyZAstyzXBQ'"
Не используйте простые кавычки вокруг PAT (токен личного доступа)
merge_requests/11/?private_token=DcpikqosHCyZAstyzXBQ
@NoobEditor Я так и думал: я никогда не использовал кавычки при использовании PAT в своем URL-адресе.
@NoobEditor Я отредактировал ответ, чтобы удалить '??' части, так как это была опечатка.
извините за опечатку, у меня было
?нет??но да, кавычки вокруг токена были проблемой!! :)