Skip to content

Commit

Permalink
getServiceAuth: set iat, jti
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBuchanan314 committed Dec 28, 2024
1 parent d400b12 commit b826d21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/millipds/auth_bearer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ async def authentication_handler(request: web.Request, *args, **kwargs):
algorithms=[alg],
audience=db.config["pds_did"],
options={
"require": ["exp", "lxm"], # consider iat?
"require": ["exp", "iat", "lxm"],
"verify_exp": True,
"verify_iat": True,
"strict_aud": True, # may be unnecessary
},
)
Expand Down
3 changes: 3 additions & 0 deletions src/millipds/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import io
import json
import uuid
import hashlib

import apsw
Expand Down Expand Up @@ -298,6 +299,8 @@ async def server_get_service_auth(request: web.Request):
"aud": aud,
"lxm": lxm,
"exp": exp,
"iat": now,
"jti": str(uuid.uuid4())
},
signing_key,
algorithm=crypto.jwt_signature_alg_for_pem(signing_key),
Expand Down

0 comments on commit b826d21

Please sign in to comment.