Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
eb7650d
Draft of Tiled-based sync-experiment
nmaytan Nov 18, 2025
5231bdc
Cleanups
nmaytan Nov 18, 2025
6ea4e83
Smoothing out wrinkles
nmaytan Nov 19, 2025
fcc593c
Update requirements.txt
nmaytan Nov 20, 2025
c61b6cb
Add catalog root node tags to API keys
nmaytan Nov 21, 2025
8f6679e
Upper the beamline in the root node tag
nmaytan Nov 21, 2025
9e25134
Treat decrypt failure as missing key
nmaytan Nov 25, 2025
1a03caf
Fix vars in cache PQ
nmaytan Nov 25, 2025
aee5df0
Update terminology used by sync-experiment
nmaytan Nov 25, 2025
508fe78
Add note about duo prompt to login message
nmaytan Nov 25, 2025
b4392f0
Add unsync_experiment, update switch_proposal, correct use cases of n…
nmaytan Nov 26, 2025
d792570
Sort data_sessions used for Redis keys to ensure determinism
nmaytan Nov 26, 2025
a16874b
Make switch_proposal work from CLI
nmaytan Nov 26, 2025
7dd2cd8
Fix method name for authz check
nmaytan Nov 26, 2025
bf6af70
Remove redundant lowers for beamline
nmaytan Dec 3, 2025
8e676e9
Add 'ts' for timestamp keys
nmaytan Dec 3, 2025
c4e2262
Use __missing__ to default normalized beamline
nmaytan Dec 3, 2025
37f1cf5
Add prompt for Duo passcode or method
nmaytan Dec 4, 2025
d721718
Minor exception tweaks
nmaytan Dec 4, 2025
a9a0d70
Update docstrings
nmaytan Dec 4, 2025
ca51763
Fix access_tags dtype, update prints
nmaytan Dec 4, 2025
52529c8
Restrict scopes on generated apikeys
nmaytan Dec 8, 2025
78a2646
Remove apikeys scope
nmaytan Dec 9, 2025
05b1b3c
Revoke api keys instead of caching
nmaytan Apr 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restrict scopes on generated apikeys
  • Loading branch information
nmaytan committed Dec 8, 2025
commit 52529c82c6bb06799362fb74d53a5aebdea2bb96
3 changes: 2 additions & 1 deletion nslsii/sync_experiment/sync_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,15 @@ def create_tiled_context(username, password, duo_append, beamline, endstation):
def create_api_key(tiled_context, data_sessions, beamline):
access_tags = [data_session for data_session in data_sessions]
access_tags.append(f"_ROOT_NODE_{beamline.upper()}")
scopes = ["read:data", "read:metadata", "apikeys"]
expires_in = "7d"
hostname = os.getenv("HOSTNAME", "unknown host")
note = f"Auto-generated by sync-experiment from {hostname}"

if expires_in and expires_in.isdigit():
expires_in = int(expires_in)
info = tiled_context.create_api_key(
access_tags=access_tags, expires_in=expires_in, note=note
access_tags=access_tags, scopes=scopes, expires_in=expires_in, note=note
)
return info

Expand Down