MCPcopy Create free account
hub / github.com/kubernetes/test-infra / github_client

Method github_client

gubernator/github_auth.py:28–43  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

26
27class Endpoint(view_base.BaseHandler):
28 def github_client(self):
29 client_key = 'github_client'
30 if '.appspot.com' not in self.request.host and \
31 not self.request.host.startswith('localhost:'):
32 client_key = 'github_client_' + self.request.host
33 if not self.app.config.get(client_key):
34 try:
35 self.app.config[client_key] = secrets.get(client_key)
36 except KeyError:
37 self.abort(500,
38 body_template=(
39 'An admin must <a href="/config">'
40 'configure GitHub secrets</a> for %r first.'
41 % self.request.host))
42 client = self.app.config[client_key]
43 return client['id'], client['secret']
44
45 def maybe_redirect(self, target):
46 """

Callers 1

getMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected