-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from bcgov/ssoteam-1456
feat: sessions job
- Loading branch information
Showing
20 changed files
with
937 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Go CI | ||
|
||
on: | ||
push: | ||
paths: | ||
- aggregator/** | ||
- .github/workflows/test.yaml | ||
|
||
|
||
defaults: | ||
run: | ||
working-directory: aggregator | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ^1.21.0 | ||
|
||
- name: Install dependencies | ||
run: go mod download | ||
|
||
- name: Run kc tests | ||
run: | | ||
cd keycloak | ||
go test -v | ||
- name: Run session tests | ||
run: | | ||
cd model | ||
go test -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ config.json | |
build | ||
__pycache__ | ||
.env | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
aggregator/alembic/versions/5bfc2a71a71f_create_sessions_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"""create sessions table | ||
Revision ID: 5bfc2a71a71f | ||
Revises: 3999a4f6f9c0 | ||
Create Date: 2024-05-15 17:05:50.453140 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from datetime import datetime | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '5bfc2a71a71f' | ||
down_revision = '3999a4f6f9c0' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('client_sessions', | ||
sa.Column('environment', sa.String(length=255), nullable=False), | ||
sa.Column('realm_id', sa.String(length=255), nullable=False), | ||
sa.Column('client_id', sa.String(length=255), nullable=False), | ||
sa.Column('active_sessions', sa.Integer(), nullable=False), | ||
sa.Column('offline_sessions', sa.Integer(), nullable=False), | ||
sa.Column('date', sa.TIMESTAMP(timezone=True), nullable=False, server_default=sa.func.current_timestamp()), | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('client_sessions') | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.