-
Notifications
You must be signed in to change notification settings - Fork 74
Feature/OIDC groups management #1147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dev-cti
wants to merge
9
commits into
CERT-Polska:master
Choose a base branch
from
dev-cti:feature/oidc_groups_management
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3a95c38
Automatic management of OIDC groups
dev-cti 663f045
Bump version to 2.18.0
dev-cti e990542
fix: Import order
dev-cti 1bb5370
fix linter
dev-cti bf59aaa
fix: Remove OIDC Group configuration from server info response
dev-cti 442b149
feat: Automatc management of OIDC groups (Per provider configuration)
dev-cti 1782602
feat Update documentation
dev-cti 6f172ed
feat Update database migration script following rebase on master
dev-cti 619e755
Web sources linting
psrok1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
44 changes: 44 additions & 0 deletions
44
mwdb/model/migrations/versions/7nsxysyisgrc_add_group_oidc_member.py
This file contains hidden or 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,44 @@ | ||
| """Add group oidc provider | ||
|
|
||
| Revision ID: 7nsxysyisgrc | ||
| Revises: 01dea56ffaf7 | ||
| Create Date: 2026-02-24 10:36:52.350767 | ||
|
|
||
| """ | ||
| import sqlalchemy as sa | ||
| from alembic import op | ||
|
|
||
| from mwdb.model import OpenIDGroupManagementMode | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "7nsxysyisgrc" | ||
| down_revision = "01dea56ffaf7" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
| def upgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| op.add_column("group", sa.Column("openid_provider_id", sa.Integer, nullable=True)) | ||
| op.create_foreign_key( | ||
| None, "group", "openid_provider", ["openid_provider_id"], ["id"], ondelete="SET NULL" | ||
| ) | ||
|
|
||
| op.execute( | ||
| "CREATE TYPE openidgroupmanagementmode AS ENUM ('NONE', 'FULL', 'MIXED');" | ||
| ) | ||
|
|
||
| op.add_column("openid_provider", sa.Column("oidc_groups_management_mode", sa.Enum(OpenIDGroupManagementMode), nullable=False)) | ||
| op.add_column("openid_provider", sa.Column("oidc_groups_match_pattern", sa.Text(), nullable=False)) | ||
| op.add_column("openid_provider", sa.Column("oidc_groups_replace_pattern", sa.Text(), nullable=False)) | ||
| # ### end Alembic commands ### | ||
|
|
||
|
|
||
| def downgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| op.drop_constraint(None, "group", type_="foreignkey") | ||
| op.drop_column("group", "openid_provider_id") | ||
|
|
||
| op.drop_column("openid_provider", "oidc_groups_management_mode") | ||
| op.drop_column("openid_provider", "oidc_groups_match_pattern") | ||
| op.drop_column("openid_provider", "oidc_groups_replace_pattern") | ||
| # ### end Alembic commands ### |
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if FK is set to
openid_provider.idbecause id is the PK (even ifnamehas unique constraint). I see why name was chosen - onlynameis passed tomwdb.core.oauth.provider.OpenIDProviderobject andcreate_user_groupsrequires reference to the provider entity. I think it would be better to change the interface of OpenIDProvider object interface instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done