diff options
Diffstat (limited to 'distixapi/authn.py')
-rw-r--r-- | distixapi/authn.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/distixapi/authn.py b/distixapi/authn.py new file mode 100644 index 0000000..53816b6 --- /dev/null +++ b/distixapi/authn.py @@ -0,0 +1,18 @@ +# Functions for checking authantication for API clients. + + +def get_credentials(request): + '''Return username, password of API client. + + They're assumed to be conveyed in an Authorization header using + Basic Auth. + + ''' + + raise AuthenticationError('No Authorization header') + + + +class AuthenticationError(Exception): + + pass |