Revision 85414b69
b/daemons/ganeti-rapi | ||
---|---|---|
76 | 76 |
|
77 | 77 |
""" |
78 | 78 |
if req.private is None: |
79 |
(HandlerClass, items, args) = self._resmap.getController(req.request_path) |
|
79 |
(HandlerClass, items, args) = \ |
|
80 |
self._resmap.getController(req.request_path) |
|
80 | 81 |
|
81 | 82 |
ctx = RemoteApiRequestContext() |
82 | 83 |
ctx.handler = HandlerClass(items, args, req) |
... | ... | |
97 | 98 |
|
98 | 99 |
return req.private |
99 | 100 |
|
101 |
def GetAuthRealm(self, req): |
|
102 |
"""Override the auth realm for queries. |
|
103 |
|
|
104 |
""" |
|
105 |
ctx = self._GetRequestContext(req) |
|
106 |
if ctx.handler_access: |
|
107 |
return self.AUTH_REALM |
|
108 |
else: |
|
109 |
return None |
|
110 |
|
|
100 | 111 |
def Authenticate(self, req, username, password): |
101 | 112 |
"""Checks whether a user can access a resource. |
102 | 113 |
|
b/lib/http/auth.py | ||
---|---|---|
188 | 188 |
|
189 | 189 |
return self.Authenticate(req, user, password) |
190 | 190 |
|
191 |
def AuthenticateBasic(self, req, user, password):
|
|
191 |
def Authenticate(self, req, user, password): |
|
192 | 192 |
"""Checks the password for a user. |
193 | 193 |
|
194 | 194 |
This function MUST be overriden by a subclass. |
Also available in: Unified diff