-
Notifications
You must be signed in to change notification settings - Fork 8
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
Create endpoint for checking LORIS integration - retrieve server configuration (M2-7429) #1548
Merged
david-montano-metalab
merged 23 commits into
loris-integration-phase-2
from
feature/M2-6632-loris-retrieve-configuration
Sep 20, 2024
Merged
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
a64b123
feat: implemented retrieval of integrations
david-montano-metalab a03a350
fix: ruff issues
david-montano-metalab cc514a7
fix: fixing integrations access validation
david-montano-metalab 14bb17e
fix: ruff format
david-montano-metalab f10c8fa
fix: specifying https in loris client
david-montano-metalab 3f1008e
fix: creating public and private versions of integrations domain object
david-montano-metalab 540c96f
fix: fixing ruff
david-montano-metalab 5e105e4
fix: ruff reformat some files
david-montano-metalab af69828
fix: fixing the retrieval of loris projects
david-montano-metalab dd759f2
fix: added new test for retrieval of configurations
david-montano-metalab ed97c5b
fix: adding integration retrieval test
david-montano-metalab 4d2e9d1
fix: fix ruff formatting
david-montano-metalab f96e7a9
fix: removing type in check access
david-montano-metalab 8ea76da
fix: removing unneded errors
david-montano-metalab d95b7a9
fix: remove import
david-montano-metalab ffb658f
fix: fixing test
david-montano-metalab 1454e95
fix: fixes wrong reference to AvailableIntegrations type when retriev…
david-montano-metalab c79d14b
fix: running make cq to fix files with formatting issues
david-montano-metalab 763819a
fix: removing enable and disable integration endpoints
david-montano-metalab d062779
fix: removing uneeded change on ReviewFlow
david-montano-metalab f76c63b
fix: removing files that have nothing to do with the PR contents and …
david-montano-metalab b171730
fix: updating name of integrations service retriever given that it re…
david-montano-metalab a5a0021
fix: renaming integration service method retrieve_integration back
david-montano-metalab 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 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
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
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 |
---|---|---|
@@ -1,29 +1,44 @@ | ||
import uuid | ||
import json | ||
|
||
from apps.integrations.db.schemas import IntegrationsSchema | ||
from apps.integrations.domain import AvailableIntegrations | ||
from apps.shared.domain import InternalModel | ||
from apps.shared.domain import InternalModel, PublicModel | ||
|
||
|
||
class IntegrationMeta(InternalModel): | ||
class LorisIntegration(InternalModel): | ||
hostname: str | ||
username: str | ||
password: str | ||
project: str | None | ||
|
||
|
||
class Integrations(InternalModel): | ||
applet_id: uuid.UUID | ||
type: AvailableIntegrations | ||
configuration: IntegrationMeta | ||
password: str | None | ||
project: str | ||
|
||
@classmethod | ||
def from_schema(cls, schema: IntegrationsSchema): | ||
return cls(applet_id=schema.applet_id, type=schema.type, configuration=schema.configuration) | ||
new_loris_integration_dict = json.loads(schema.configuration.replace("'", '"')) | ||
new_loris_integration = cls( | ||
hostname=new_loris_integration_dict["hostname"], | ||
username=new_loris_integration_dict["username"], | ||
password=new_loris_integration_dict["password"], | ||
project=new_loris_integration_dict["project"], | ||
) | ||
return new_loris_integration | ||
|
||
def __repr__(self): | ||
return "LorisIntegration()" | ||
|
||
|
||
class IntegrationsCreate(InternalModel): | ||
applet_id: uuid.UUID | ||
class LorisIntegrationPublic(PublicModel): | ||
hostname: str | ||
username: str | ||
password: str | ||
project: str | ||
|
||
@classmethod | ||
def from_schema(cls, schema: IntegrationsSchema): | ||
new_loris_integration_dict = json.loads(schema.configuration.replace("'", '"')) | ||
new_loris_integration = cls( | ||
hostname=new_loris_integration_dict["hostname"], | ||
username=new_loris_integration_dict["username"], | ||
project=new_loris_integration_dict["project"], | ||
) | ||
return new_loris_integration | ||
|
||
def __repr__(self): | ||
return "LorisIntegrationPublic()" |
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.
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.
Avoid committing unrelated files, unless this was related to
ruff
checks?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.
this is because new ruff version, I did the same in "develop" branch