Tweak model for access tokens

main
Thomas Sileo 2022-07-10 12:06:16 +02:00
parent e8374de0c7
commit 43ef85038b
3 changed files with 2 additions and 3 deletions

View File

@ -21,7 +21,7 @@ def upgrade() -> None:
op.create_table('indieauth_access_token', op.create_table('indieauth_access_token',
sa.Column('id', sa.Integer(), nullable=False), sa.Column('id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(timezone=True), nullable=False), sa.Column('created_at', sa.DateTime(timezone=True), nullable=False),
sa.Column('indieauth_authorization_request_id', sa.Integer(), nullable=False), sa.Column('indieauth_authorization_request_id', sa.Integer(), nullable=True),
sa.Column('access_token', sa.String(), nullable=False), sa.Column('access_token', sa.String(), nullable=False),
sa.Column('expires_in', sa.Integer(), nullable=False), sa.Column('expires_in', sa.Integer(), nullable=False),
sa.Column('scope', sa.String(), nullable=False), sa.Column('scope', sa.String(), nullable=False),

View File

@ -65,7 +65,6 @@ async def verify_signature(
key_id = doc["signature"]["creator"] key_id = doc["signature"]["creator"]
key = await _get_public_key(db_session, key_id) key = await _get_public_key(db_session, key_id)
print(key)
to_be_signed = _options_hash(doc) + _doc_hash(doc) to_be_signed = _options_hash(doc) + _doc_hash(doc)
signature = doc["signature"]["signatureValue"] signature = doc["signature"]["signatureValue"]
signer = PKCS1_v1_5.new(key.pubkey or key.privkey) # type: ignore signer = PKCS1_v1_5.new(key.pubkey or key.privkey) # type: ignore

View File

@ -423,7 +423,7 @@ class IndieAuthAccessToken(Base):
created_at = Column(DateTime(timezone=True), nullable=False, default=now) created_at = Column(DateTime(timezone=True), nullable=False, default=now)
indieauth_authorization_request_id = Column( indieauth_authorization_request_id = Column(
Integer, ForeignKey("indieauth_authorization_request.id"), nullable=False Integer, ForeignKey("indieauth_authorization_request.id"), nullable=True
) )
access_token = Column(String, nullable=False, unique=True, index=True) access_token = Column(String, nullable=False, unique=True, index=True)