File: github_user_manager.py

package info (click to toggle)
azure-functions-devops-build 0.0.22-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 556 kB
  • sloc: python: 2,422; sh: 12; makefile: 8
file content (16 lines) | stat: -rw-r--r-- 751 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from ..base.base_github_manager import BaseGithubManager

class GithubUserManager(BaseGithubManager):

    def check_github_pat(self, pat):
        header_parameters = self.construct_github_request_header(pat)
        request = self._client.get('/')
        response = self._client.send(request, header_parameters)
        if response.status_code // 100 == 2:
            return True
        return False