mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
ci: Fix flake8 errors
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
This commit is contained in:
2 files changed
+10
-7
No files matched your search
+8
-5
@@ -68,11 +68,14 @@ def create_ticket(pkey, uid, validuntil, ip=None, tokens=None, udata=None,
|
||||
graceperiod=None, extra_fields=None):
|
||||
"""Create and return a signed mod_auth_pubtkt ticket."""
|
||||
fields = [
|
||||
'uid={}'.format(uid), 'validuntil={}'.format(validuntil, type='d'), ip
|
||||
and 'cip={}'.format(ip), tokens and 'tokens={}'.format(tokens),
|
||||
graceperiod and 'graceperiod={}'.format(graceperiod, type='d'), udata
|
||||
and 'udata={}'.format(udata), extra_fields
|
||||
and ';'.join(['{}={}'.format(k, v) for k, v in extra_fields])
|
||||
f'uid={uid}',
|
||||
'validuntil={0:d}'.format(validuntil),
|
||||
ip and f'cip={ip}',
|
||||
tokens and f'tokens={tokens}',
|
||||
graceperiod and 'graceperiod={0:d}'.format(graceperiod),
|
||||
udata and f'udata={udata}',
|
||||
extra_fields and ';'.join(
|
||||
['{}={}'.format(k, v) for k, v in extra_fields])
|
||||
]
|
||||
data = ';'.join(filter(None, fields))
|
||||
signature = 'sig={}'.format(sign(pkey, data))
|
||||
|
||||
Reference in new issue
Block a user