
* providers/saml: make AuthnContextClassRef configurable Signed-off-by: Jens Langhammer <jens@goauthentik.io> * providers/saml: fix incorrect AuthInstant Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add tests Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
17 lines
416 B
Python
17 lines
416 B
Python
"""Time utilities"""
|
|
|
|
from datetime import datetime, timedelta
|
|
|
|
from django.utils.timezone import now
|
|
|
|
|
|
def get_time_string(delta: timedelta | datetime | None = None) -> str:
|
|
"""Get Data formatted in SAML format"""
|
|
if delta is None:
|
|
delta = timedelta()
|
|
if isinstance(delta, timedelta):
|
|
final = now() + delta
|
|
else:
|
|
final = delta
|
|
return final.strftime("%Y-%m-%dT%H:%M:%SZ")
|