This authentication system hits two HTTP endpoints to check and verify the existence of users: Existance endpoint: GET http://endpoint/ with Authorization: Basic (username:) => Returns 200 if the username/email exists, 4** otherwise Verification endpoint: GET http://endpoint/ with Authorization: Basic (username:password) => Returns 200 and a signed JWT with the user's username and email address if the username+password validates, 4** otherwise with the body containing an optional error message The JWT produced by the endpoint must be issued with an issuer matching that configured in the config.yaml, and the audience must be "quay.io/jwtauthn". The JWT is signed using a private key and then validated on the Quay.io side with the associated public key, found as "jwt-authn.cert" in the conf/stack directory.
28 lines
559 B
Python
28 lines
559 B
Python
"""Add JWT Authentication login service
|
|
|
|
Revision ID: 41f4587c84ae
|
|
Revises: 1f116e06b68
|
|
Create Date: 2015-06-02 16:13:02.636590
|
|
|
|
"""
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '41f4587c84ae'
|
|
down_revision = '1f116e06b68'
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
def upgrade(tables):
|
|
op.bulk_insert(tables.loginservice,
|
|
[
|
|
{'id': 5, 'name':'jwtauthn'},
|
|
])
|
|
|
|
|
|
def downgrade(tables):
|
|
op.execute(
|
|
(tables.loginservice.delete()
|
|
.where(tables.loginservice.c.name == op.inline_literal('jwtauthn')))
|
|
)
|