File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
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.
Original file line number Diff line number Diff line change
1
+ """
2
+ dash-enterprise auth
3
+
4
+ Methods to integrate dash apps with the authentication from the
5
+ dash-deployment-server.
6
+ """
1
7
import datetime as _dt
2
8
import os as _os
3
9
import base64 as _b64
@@ -58,13 +64,24 @@ def _get_current_user_request():
58
64
59
65
@_need_request_context
60
66
def get_username ():
67
+ """
68
+ Get the current user.
69
+
70
+ :return: The current user.
71
+ :rtype: str
72
+ """
61
73
res_json = _get_current_user_request ()
62
74
63
75
return res_json .get ('username' )
64
76
65
77
66
78
@_need_request_context
67
79
def get_kerberos_ticket_cache ():
80
+ """
81
+ Get the kerberos ticket for the current logged user.
82
+
83
+ :return: The kerberos ticket cache.
84
+ """
68
85
res_json = _get_current_user_request ()
69
86
70
87
expiry_str = res_json ['kerberos_ticket_expiry' ]
You can’t perform that action at this time.
0 commit comments