Skip to content

Commit

Permalink
Addresses issues #1,2,3
Browse files Browse the repository at this point in the history
  • Loading branch information
ericblau committed Jan 22, 2025
1 parent 25db060 commit 2bee044
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ value from the CILogon userinfo endpoint (or create a user if one does not alrea
So as not to overtax the CILogon introspection endpoint, should many API requests come through at the same time, the token's introspection information is cached for a settable amount of time. Set the value in seconds in settings.py as TOKENAUTH_INTROSPECTION_CACHE_EXPIRATION.

You must register a CILogon OIDC client at registry.access-ci.org.
Your values for Client ID and Secret must then be put in settings as CLIENT_KEY and CLIENT_SECRET
Your values for Client ID and Secret must then be put in settings as CILOGON_CLIENT_KEY and CILOGON_CLIENT_SECRET

Settings:
CLIENT_KEY
CLIENT_SECRET
CILOGON_CLIENT_KEY
CILOGON_CLIENT_SECRET
TOKENAUTH_INTROSPECTION_CACHE_EXPIRATION

28 changes: 28 additions & 0 deletions cilogon_tokenauth/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.1.13 on 2024-11-08 22:35

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='CachedToken',
fields=[
('id', models.CharField(max_length=256, primary_key=True, serialize=False)),
('scope', models.CharField(max_length=128)),
('issued_at', models.FloatField()),
('expires_at', models.FloatField()),
('last_introspection', models.FloatField()),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
4 changes: 0 additions & 4 deletions cilogon_tokenauth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

class CachedToken(models.Model):

ID_SCOPE = 'identifiers.globus.org'
SCOPE_PERMISSIONS = {
}

id = models.CharField(max_length=256, primary_key=True)
user = models.ForeignKey(User, on_delete=models.CASCADE)
scope = models.CharField(max_length=128)
Expand Down

0 comments on commit 2bee044

Please sign in to comment.