Skip to content

Commit

Permalink
enable a service only mode (#14)
Browse files Browse the repository at this point in the history
Signed-off-by: PatStLouis <[email protected]>
  • Loading branch information
PatStLouis authored Jan 10, 2025
1 parent 6b30b84 commit 19e3d51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion backend/app/routers/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ async def publish_credential(request_body: Publication):
detail="Unexpected error occured while trying to issue the credential.",
)

await OrgbookPublisher().forward_credential(vc, credential_registration)
# Forward credential to Orgbook unless set in service only mode
if settings.ORGBOOK_SYNC:
await OrgbookPublisher().forward_credential(vc, credential_registration)

mongo.insert(
"CredentialRecord",
Expand Down
5 changes: 3 additions & 2 deletions backend/app/routers/registrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ async def register_credential_type(request_body: CredentialRegistration):
}
]

# Register credential type with Orgbook
await OrgbookPublisher().create_credential_type(credential_registration)
# Register credential type with Orgbook unless set in service only mode
if settings.ORGBOOK_SYNC:
await OrgbookPublisher().create_credential_type(credential_registration)

# Store credential type record
try:
Expand Down
1 change: 1 addition & 0 deletions backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Settings(BaseSettings):
ORGBOOK_URL: str = os.getenv("ORGBOOK_URL")
ORGBOOK_API_URL: str = f"{ORGBOOK_URL}/api/v4"
ORGBOOK_VC_SERVICE: str = f"{ORGBOOK_URL}/api/vc"
ORGBOOK_SYNC: bool = os.getenv("ORGBOOK_SYNC", True)

DID_WEB_SERVER_URL: str = os.getenv("DID_WEB_SERVER_URL")
PUBLISHER_MULTIKEY: str = os.getenv("PUBLISHER_MULTIKEY")
Expand Down

0 comments on commit 19e3d51

Please sign in to comment.