Annotation Rest API microservice with file upload.

furkankalkan 06a25a187e fix: update attachments 1 week ago
.github 0a96c233a6 Update docker-image.yml 9 months ago
src 06a25a187e fix: update attachments 1 week ago
.gitignore 42f8aafecb TRD-4641 feat: note can have unlimited attachment 9 months ago
Dockerfile ffccbc12d1 add two phase build 3 years ago
LICENSE c029e92879 Initial commit 3 years ago
README.md 0235183def has_attachment field & PDF key endpoint added. 2 years ago
requirements.txt ad6d451053 Cors added 3 years ago

README.md

Note Service

This project written with Flask web framework. It use flask-smorest for REST API, Pyctuator for actuator endpoint and Flask-SQLAlchemy for handle DB queries. Swagger UI documentation and API validations handled by flask-smorest itself. flask-smorest uses Marshmallow models for marshalling and unmarshalling objects in request and response. This models also used by Swagger UI.

In project, different project parts divided into independent Blueprints and modules. This modules can be seen in modules directory. App modules has their own views, controllers, database models, schemas, error handlers, decorators and utils.

Common non-blueprint things (incl. DB instance, utils, ...) has own modules in project root. App configs stored in config.py and can be overrided with environment variables via apply_settings() function in settings.py.

Currently, this service has two independent blueprints: Auth (/auth) and Api (/api/v1/notes). In Auth blueprint, there are endpoints for redirecting to SSO (/auth/login) and getting access token from SSO (/auth/login/callback).

Access token will persist in cookie for future use.

Environment Variables

  • OAUTHLIB_INSECURE_TRANSPORT: Set True for non-https environments

  • __SERVICE_SQLALCHEMY_DATABASE_URI: Database URI. Ex. sqlite:///db.sqlite

  • __SERVICE_ACTUATOR_BASE_URI: Full URL for actuator endpoint.

  • __SERVICE_SSO_DISCOVERY_URL: OpenID configuration endpoint of SSO tool.

  • __SERVICE_SSO_CLIENT_ID: SSO Client ID

  • __SERVICE_SSO_CLIENT_SECRET: SSO Client Secret

  • __SERVICE_SSO_TARGET_AUDIENCE: SSO Audience for JWT validation.

  • __SERVICE_JWT_COOKIE_NAME: JWT token cookie name

  • __SERVICE_FILE_SERVICE_UPLOAD_URL: File service api url for uploading attachment

  • __SERVICE_FILE_SERVICE_DOWNLOAD_URL: File service api url for downloading attachment

  • __SERVICE_PDF_SERVICE_KEY_URL: PDF service api url for securely previewing the note attachments

  • __SERVICE_AUTHORIZED_GROUP: Set group name in SSO (Put / before it for Keycloak.)

Other application settings in config.py could be overrided with environment variables with __SERVICE_ prefix.