-
Notifications
You must be signed in to change notification settings - Fork 3
Cognition integration provider #302
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
base: dev
Are you sure you want to change the base?
Conversation
I see what you mean, I added an internal endpoint to refinery-gateway. Currently, SET_NULL - YES
|
Update is blocked on cognition-ui because we don't allow same integration names. This isn't the case with update, i.e. the "Update" button shouldn't be blocked if the integration name remains the same.
|
perf: rename internal delete endpoint
* Oidc identifier migrated to the users table * Search for user only if there is not oidc identifier * migrate * model * alembic merge * model * projects with access management * add access management attribute * deactivate mock up * deactivate access management * add groups/users to records * fix smaller issues * embeddings * model * update payloads * alembic fix * endpoint for sync internal * model * update logic * error handling * chore: update submodules * chore: update submodules * chore: update submodules --------- Co-authored-by: LennartSchmidtKern <[email protected]> Co-authored-by: andhreljaKern <[email protected]>
I am able to manually add users to the project record permissions even with auto sync (groups=> permission view => edit access => select user & records)
|
print(traceback.format_exc(), flush=True) | ||
return ["tokenization failed"] | ||
# TODO check if this is still needed for access management updates | ||
if not only_access_management_update: |
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.
is this still needed?
@@ -331,6 +336,100 @@ def delete_records( | |||
__delete_records(project_id, record_ids) | |||
|
|||
|
|||
def sync_access_groups_and_users_sharepoint(project_id: str, integration_id: str, permissions_users: Dict[str, Any], record_ids: Optional[List[str]]) -> None: | |||
try: |
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.
long try:
body
|
||
|
||
def add_access_groups_or_users(project_id: str, record_ids: List[str], group_ids: Optional[List[str]] = None, user_ids: Optional[List[str]] = None) -> None: | ||
try: |
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.
see above
@@ -263,3 +263,15 @@ def check_user_exists(email: str) -> bool: | |||
if i["traits"]["email"].lower() == email.lower(): | |||
return True | |||
return False | |||
|
|||
|
|||
def get_user_from_search(email: str) -> bool: |
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.
can the existing function get_userid_from_mail
be used to avoid code duplication?
prev_filter_attributes = embedding_item.filter_attributes or [] | ||
new_filter_attributes = list(set(prev_filter_attributes + filter_attributes)) | ||
embedding_item.filter_attributes = new_filter_attributes | ||
general.commit() |
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.
commit after the for loop? the if statement below also issues another commit
return project.get_all_with_access_management(organization_id) | ||
|
||
|
||
def activate_access_management(project_id): |
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.
typing
str(embedding_item.id), | ||
record_ids=changed_records_ids if partial_update else None, | ||
) | ||
return errors |
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.
typing
|
||
except Exception as e: | ||
print(traceback.format_exc(), flush=True) | ||
return [str(e)] |
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.
typing
@@ -162,4 +162,20 @@ def __migrate_kratos_users(): | |||
if user_database.sso_provider != sso_provider: | |||
user_database.sso_provider = sso_provider | |||
|
|||
if user_database.oidc_identifier is None: |
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.
how is the oidc_identifier
used?
@@ -70,6 +70,38 @@ def get_all_projects(request: Request) -> Dict: | |||
return pack_json_result(projects) | |||
|
|||
|
|||
# TO DO, some admin check should be added here | |||
@router.get("/all-projects-with-access-management") | |||
def get_all_projects_with_tokens(request: Request) -> Dict: |
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.
I could be mistaken, we don't usually add return typing in routes right?
This is the main PR.
Related PRs
New repository
Important
Retrieve:
Tenant and Client IDs in Azure Portal (@kern.ai) => Key Vaults => dev-krn-accompio => Objects -> Secrets => O365-TENANT-ID and O365-UNATTENDED-CLIENT-ID
Certificate .pfx file in Azure Portal (@kern.ai) => Key Vaults => dev-krn-admin => Objects -> Certificates => dev-accompio-certificate =>
Download in PFX/PEM format
. The passphrase is an empty string. Use" "
(space) as an environment variable value (reference).Document Library ID:
b!zzhsLojhuEaDy3fQIjUZxLC67xk1l9lFpzlKVAQ1-uDYfIQ6DMGYQrkemTRS4V0Q
Use dev-setup@cognition-integration-provider to run cognition-integration-provider (
bash start -a -b cognition-integration-provider
)Tests
Tests were not developed for this container due to long running extraction and transformation tasks
Affected areas
dev-setup
,deployment-cognition
,deployment-managed-cognition
refinery-submodule-model
cognition-task-master
admin-dashboard
cognition-ui
refinery-ui
refinery-gateway
cognition-gateway
cognition-integration-provider
Performance
MP - multiprocessing (# workers)

SP - singleprocessing