Skip to content

Commit 7665168

Browse files
committed
Add changelog + docstrings.
1 parent cd9a4d0 commit 7665168

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## [0.0.1] -
2+
### Added
3+
**Initial release**
4+
5+
Adapted from dash-auth
6+
7+
- `create_logout_button` - create a dcc.LogoutButton with the `logout_url` set to the dash-deployment-server logout route.
8+
- `get_username` - get the currently logged in user.
9+
- `get_kerberos_ticket_cache` - Kerberos ticket for environments that supports it.

dash_enterprise_auth/__init__.py

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
"""
2+
dash-enterprise auth
3+
4+
Methods to integrate dash apps with the authentication from the
5+
dash-deployment-server.
6+
"""
17
import datetime as _dt
28
import os as _os
39
import base64 as _b64
@@ -58,13 +64,24 @@ def _get_current_user_request():
5864

5965
@_need_request_context
6066
def get_username():
67+
"""
68+
Get the current user.
69+
70+
:return: The current user.
71+
:rtype: str
72+
"""
6173
res_json = _get_current_user_request()
6274

6375
return res_json.get('username')
6476

6577

6678
@_need_request_context
6779
def get_kerberos_ticket_cache():
80+
"""
81+
Get the kerberos ticket for the current logged user.
82+
83+
:return: The kerberos ticket cache.
84+
"""
6885
res_json = _get_current_user_request()
6986

7087
expiry_str = res_json['kerberos_ticket_expiry']

0 commit comments

Comments
 (0)