diff --git a/backend/app/routers/credentials.py b/backend/app/routers/credentials.py index 0249a12..20c8d68 100644 --- a/backend/app/routers/credentials.py +++ b/backend/app/routers/credentials.py @@ -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", diff --git a/backend/app/routers/registrations.py b/backend/app/routers/registrations.py index e63b697..5faaf2c 100644 --- a/backend/app/routers/registrations.py +++ b/backend/app/routers/registrations.py @@ -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: diff --git a/backend/config.py b/backend/config.py index 3177964..caef979 100644 --- a/backend/config.py +++ b/backend/config.py @@ -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")