Change login url from `login_redirect` to `login`

This commit is contained in:
mike cullerton 2022-07-27 18:05:27 -04:00
parent bb9d4a28f9
commit 8bb9868b2e
2 changed files with 15 additions and 7 deletions

View File

@ -10,7 +10,7 @@ security:
- jwt: ["secret"] - jwt: ["secret"]
paths: paths:
/login_redirect: /login:
parameters: parameters:
- name: redirect_url - name: redirect_url
in: query in: query
@ -57,12 +57,12 @@ paths:
operationId: spiffworkflow_backend.routes.user.logout operationId: spiffworkflow_backend.routes.user.logout
summary: Logout authenticated user summary: Logout authenticated user
tags: tags:
- User - Authentication
responses: responses:
'200': '200':
description: Logout Authenticated User description: Logout Authenticated User
/api-login: /login_swagger:
parameters: parameters:
- name: uid - name: uid
in: query in: query
@ -87,7 +87,7 @@ paths:
operationId: spiffworkflow_backend.routes.user.api_login operationId: spiffworkflow_backend.routes.user.api_login
summary: Authenticate user for API access summary: Authenticate user for API access
tags: tags:
- User - Authentication
responses: responses:
'304': '304':
description: Redirection to the hosted frontend with an auth_token header. description: Redirection to the hosted frontend with an auth_token header.
@ -107,6 +107,7 @@ paths:
application/json: application/json:
schema: schema:
$ref: "#components/schemas/OkTrue" $ref: "#components/schemas/OkTrue"
/process-groups: /process-groups:
parameters: parameters:
- name: page - name: page
@ -754,6 +755,7 @@ paths:
type: array type: array
items: items:
$ref: "#/components/schemas/Task" $ref: "#/components/schemas/Task"
/process-instance/{process_instance_id}/tasks: /process-instance/{process_instance_id}/tasks:
parameters: parameters:
- name: process_instance_id - name: process_instance_id
@ -780,6 +782,7 @@ paths:
type: array type: array
items: items:
$ref: "#/components/schemas/Task" $ref: "#/components/schemas/Task"
/tasks/{process_instance_id}/{task_id}: /tasks/{process_instance_id}/{task_id}:
parameters: parameters:
- name: task_id - name: task_id

View File

@ -19,6 +19,11 @@ class UserModel(SpiffworkflowBaseDBModel):
"""UserModel.""" """UserModel."""
__tablename__ = "user" __tablename__ = "user"
__table_args__ = (
db.UniqueConstraint(
"service", "service_id", name="service_key"
),
)
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(50), nullable=False, unique=True) username = db.Column(db.String(50), nullable=False, unique=True)
uid = db.Column(db.String(50), unique=True) uid = db.Column(db.String(50), unique=True)
@ -93,9 +98,9 @@ class UserModel(SpiffworkflowBaseDBModel):
@classmethod @classmethod
def from_open_id_user_info(cls, user_info): def from_open_id_user_info(cls, user_info):
instance = cls() instance = cls()
instance.service = 'keycloak', instance.service = 'keycloak'
instance.service_id = user_info['sub'], instance.service_id = user_info['sub']
instance.name = user_info['preferred_username'], instance.name = user_info['preferred_username']
instance.username = user_info['sub'] instance.username = user_info['sub']
return instance return instance