Skip to content

Commit

Permalink
Transparent path master (#358)
Browse files Browse the repository at this point in the history
* Update ISSUE_TEMPLATE.md

Add complexity estimate

* update travis configs

* update travis configs

* move build to travis script

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* cleanup initital data

* cleanup initital data

* cleanup initital data

* remove organization_name

* remove organization_name

* update travis var

* update travis var

* update travis var

* revert keys

* fix org

* fix org

* fix org

* fix org

* fix org

* fix org

* fix org

* turn off tagged commits for builds

* update docker compose with email host

* update docker compose with email host

* update docker compose with email host

* update docker compose with email host

* add options function to gateway

* update permissions with options

* refactor: Allow organization name to be accepted when creating core user

* chore: Update initial setup

* test: Refactored test cases for organization

* fix: Flake8 warnings

* Flake8 Error fixes

* chore: Flake8 fixes for whitespaces and f-strings

* chore: Resolved ContextualVersionConflict

* chore: requests dependency version

* Changes for Oauth in Initial Script

* removed changed in gateway view to allow options methid from service

* removed changed in gateway view to allow options methid from service

* Commenting out options function for options response of services

* email alert message for shipment to user

* Use generalised function name

* initial commit

* added seperate endpoint for update

* add more illutratative field in message

* remove commented code in html template of shipment alert

* modifify html template name to send email alert for shipment

* remove conflict

* Allow user to subscribe to email alert in Profile

* fixed linting

* changed shipment id to shipment_uuid

* added email_alert_flag to CoreUser Serializer

* fixed linting

* added boolean field in organisation

* Resolved issue in OPTIONS method via Core

* TransparentPath/issues/45:add radis field in organization

* Added support for multiple email alerts

* initial commit

* return only org names

* removed debugging info

* change in request format of email alert endpoint (#53)

* change in request format of email alert endpoint

* resolved flake-8 error

* Added consortium table and its endpoint (#50)

* added consortium table and its endpoint

* formatted as per flake8

* resolved falke8 error

* Added organization types (#56)

* Added organization type

* Formatting fixes

* Corrected test case

* Approval email for newly registered users (#57)

* Added organization type

* Formatting fixes

* Corrected test case

* Approval email for new users

* Resolved flake8 warnings

* Fixed issue in tests

* Resolved comments

* Updated email template for alerts

* Updated email template for alerts

* Organization names coming from open API as list of names (#60)

* Resolve permission issue for "/organization/fetch_orgs/" endpoint (#64)

* resolved permission issue for fetch_org endpoint

* resloved flake-8 error

* Add API endpoint for organization type (#65)

* resolved permission issue for fetch_org endpoint

* resloved flake-8 error

* add endpoint for organization type

* corrected comments

* change permission level

* add create and edit date in organization type

* change permission level to only organization admin

* Updated configuration for consortium (#70)

* Updated configuration for consortium

* Flake8 fixes

* Configuration for user alert preferences (#73)

* Configuration for user alert preferences

* Flake8 fixes

* Fixes in test cases

* update consortium table for organization uuid (#75)

* Modifications in email templates (#77)

* Changes in email template for environmental alerts

* Preferences for email alerts

* Updated super admin credentials

* change permission level for consortium table (#79)

* filter consortium by organization (#81)

* update consortium array field (#82)

* Changed permission level for consortium (#85)

* Changed permission level for consortium

* Updated flake8 fixes

* create consortium if custody create (#87)

* create consortium if custody create

* resolved flake8 error

* Fix issue for retrieve query by uuid (#88)

* Revert "Fix issue for retrieve query by uuid (#88)"

This reverts commit d2f78ef.

* Handled boolean for CORS_ORIGIN_ALLOW_ALL

* Updated Bravado Core version

* Return response data only for PUT, POST, DELETE (#97)

* Added default radius for organization

* Allow unlimited line size for request

* sensor service email alert for unassigned moving sensor (#105)

* squashed migration files

* construct shipment_url only when shipment_id is present

* remove shipment related from email if shipment is not available

* Handle when no custody organization mapped to custodian

* Environmental warning timezone. (#108)

* Change warning timezone to user's timezone only when core user has timezone

* append ('UTC') for UTC timezone

* Remove Travis

* Remove timestamp from alert messages (#110)

* removed 'Captured at' from alert message

* stop sending datetime in alert message

* Gunicorn timeout configuration

* buildly-core gitHub actions (#112)

* github action for unit test

* update triggers for unit test github action

* github action for dev docker image build and push

* github action for demo docker image build and push

* github action for production docker image build and push

* added pre-commit hooks for dev, demo and prod branch

* update name for unit_test

* Github Actions for Unit Test (#114)

* Gunicorn timeout configuration

* Fixes done for flake

* Remove dev deployment setup

* Setup github actions

* Bump the pip group group in /requirements with 6 updates

Bumps the pip group group in /requirements with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [django](https://github.com/django/django) | `2.2.10` | `3.2.24` |
| [django-filter](https://github.com/carltongibson/django-filter) | `2.2.0` | `2.4.0` |
| [djangorestframework](https://github.com/encode/django-rest-framework) | `3.9.4` | `3.11.2` |
| [requests](https://github.com/psf/requests) | `2.25.0` | `2.31.0` |
| [aiohttp](https://github.com/aio-libs/aiohttp) | `3.5.4` | `3.9.2` |
| [ipython](https://github.com/ipython/ipython) | `7.2.0` | `8.10.0` |


Updates `django` from 2.2.10 to 3.2.24
- [Commits](django/django@2.2.10...3.2.24)

Updates `django-filter` from 2.2.0 to 2.4.0
- [Release notes](https://github.com/carltongibson/django-filter/releases)
- [Changelog](https://github.com/carltongibson/django-filter/blob/main/CHANGES.rst)
- [Commits](carltongibson/django-filter@2.2.0...2.4.0)

Updates `djangorestframework` from 3.9.4 to 3.11.2
- [Release notes](https://github.com/encode/django-rest-framework/releases)
- [Commits](encode/django-rest-framework@3.9.4...3.11.2)

Updates `requests` from 2.25.0 to 2.31.0
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.25.0...v2.31.0)

Updates `aiohttp` from 3.5.4 to 3.9.2
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.5.4...v3.9.2)

Updates `ipython` from 7.2.0 to 8.10.0
- [Release notes](https://github.com/ipython/ipython/releases)
- [Commits](ipython/ipython@7.2.0...8.10.0)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
  dependency-group: pip-security-group
- dependency-name: django-filter
  dependency-type: direct:production
  dependency-group: pip-security-group
- dependency-name: djangorestframework
  dependency-type: direct:production
  dependency-group: pip-security-group
- dependency-name: requests
  dependency-type: direct:production
  dependency-group: pip-security-group
- dependency-name: aiohttp
  dependency-type: direct:production
  dependency-group: pip-security-group
- dependency-name: ipython
  dependency-type: direct:production
  dependency-group: pip-security-group
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update dev-build.yml

The entire file was commented out, checking in without comments.

* Update base.txt

Fix 3.9,.2 aiohttp not found error from dependabot

* [Security] Bump django from 2.2.10 to 2.2.13

Bumps [django](https://github.com/django/django) from 2.2.10 to 2.2.13. **This update includes security fixes.**
- [Release notes](https://github.com/django/django/releases)
- [Commits](django/django@2.2.10...2.2.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* replace buildly-ui to buildly-react-template

* Issue #318: Bump django-oauth-toolkit from 1.3.0 to 1.3.2 (#325)

* Create GitHub actions for reviews (#329)

* Create GitHub actions for reviews

* Add docker build step

* Add CodeQL for code analysis (#331)

* Create codeql-analysis.yml

* Fix review workflow

* feat: Create GitHub Actions workflow to publish Docker images (#332)

* Create GitHub Actions workflow to publish Docker images

* Add build release configuration file

* Update README configuration table

* fix: Fix the release workflow

* fix: Fix the build & release from release workflow

* fix: Fix semantic release (#334)

* rm toladata text (#336)

* [Security] Bump django from 2.2.13 to 2.2.18 (#339)

Bumps [django](https://github.com/django/django) from 2.2.13 to 2.2.18. **This update includes security fixes.**
- [Release notes](https://github.com/django/django/releases)
- [Commits](django/django@2.2.13...2.2.18)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* [Security] Bump django from 2.2.18 to 2.2.24 (#341)

* [Security] Bump aiohttp from 3.5.4 to 3.7.4 (#338)

* feat: Bump djangorestframework from 3.9.4 to 3.11.2 (#340)

* [Security] Bump djangorestframework from 3.9.4 to 3.11.2

Bumps [djangorestframework](https://github.com/encode/django-rest-framework) from 3.9.4 to 3.11.2. **This update includes a security fix.**
- [Release notes](https://github.com/encode/django-rest-framework/releases)
- [Commits](encode/django-rest-framework@3.9.4...3.11.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Fix issue with drf-yasg schema generator

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: jefmoura <jefmoura@protonmail.com>

* Create CODE_OF_CONDUCT.md (#342)

* Update README.md

* Bump django from 2.2.24 to 2.2.27 in /requirements (#345)

Bumps [django](https://github.com/django/django) from 2.2.24 to 2.2.27.
- [Release notes](https://github.com/django/django/releases)
- [Commits](django/django@2.2.24...2.2.27)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Upstream changes (Auto Approve, Social Auth, Test cases etc)

* login with github

* added django template

* removed django template

* initial commit

* remove user groups

* updated urls

* initial commit

* Updated dependency issues

* Datamesh update (#11)

* Datamesh async fixed

* Datamesh join function script

* Email alert integration (#13)

* Integration - Email Notification

* Integration - Email Notification

* updated serializer

* updated unit test

* datamesh join script (#14)

* datamesh join script

* datamesh join script

* comment removed

* updated datamesh join script

* updated datamesh join script

* updated join_record_datamesh function

* removed print statement

* Partner implementation (#17)

* Partner Implementation

* removed organization

* removed partner organization

* removed partner organization

* - partner unit test

* - updated test fixtures

* - removed comment

* Resolve permissions for Organization

* fix core endpoint issue (#21)

* fix core endpoint issue

* updated comment

* Updated environment variables

* Updated environment values

* Handle for Gateway response 400

* datamesh join:
- product <-> third party tool and
- product <-> product_team

* completed project tool service datamesh join

* completed release service datamesh join

* completed dev/partner service datamesh join

* Fix Datamesh request issue

* updated admin username and password

* revert find endpoint fix

* updated datamesh join module name

* Added script to load datamesh

* Handled blank response for join records

* datamesh POST/PUT request implementation

* updated post request for different use-cases

* datamesh implemented delete request

* post empty response validation

* updated datamesh script for pk

* converted into functions

* updated put request

* updated PUT request for case -> The relation that exists but needs to create join

* Allow users to be auto-approved after registration

* added fields on Relationship model

* model via forward lookup

* param service name via forward_lookup

* written function for the case - Handles The relation that only needs to update ID or UUID

* Get response after a POST and PUT request

* refactor the functions

* updated func parameter

* issue fix - delete join

* delete status join

* migration file

* User Type Implementation (#45)

* added user type

* admin dashboard

* added survey_status

* serializer fields added

* help text

* User profile update API (#48)

* user profile update API

* updated get_permission

* unit test cases

* added serializer field

* serializer organization_name validation

* updated core-user serializer update method

* User registration update (#53)

* register with org validation

* uncommented invitation_token method

* updated load initial script for org creation

* set auto approve to false

* core user create method

* default org name

* added new var to update

* code format

* updated gunicorn timeout

* removed unwanted files from upstream pr

* updated migration files

* added new line

* removed unwanted changes

* removed prepare_get_request() function

* updated DEFAULT_ORG to lowercase

* Fix None type DEFAULT_ORG issue

Co-authored-by: ashishkmishra36 <ashish.kumar@ajackus.com>
Co-authored-by: Ashish K Mishra <70134840+ashishkmishra36@users.noreply.github.com>
Co-authored-by: Yasmin Ansari <yasmin@ajackus.com>
Co-authored-by: mthombare <83965396+mthombare@users.noreply.github.com>
Co-authored-by: manish <manish.thombare@ajackus.com>
Co-authored-by: Yasmin Ansari <yasmin.ansari@ajackus.com>
Co-authored-by: Greg Lind <gwlind@gmail.com>

* Changes from Insights for login, datamesh and scripts to enhance datamesh (#347)

* login with github

* added django template

* removed django template

* initial commit

* remove user groups

* updated urls

* initial commit

* Updated dependency issues

* Datamesh update (#11)

* Datamesh async fixed

* Datamesh join function script

* Email alert integration (#13)

* Integration - Email Notification

* Integration - Email Notification

* updated serializer

* updated unit test

* datamesh join script (#14)

* datamesh join script

* datamesh join script

* comment removed

* updated datamesh join script

* updated datamesh join script

* updated join_record_datamesh function

* removed print statement

* Partner implementation (#17)

* Partner Implementation

* removed organization

* removed partner organization

* removed partner organization

* - partner unit test

* - updated test fixtures

* - removed comment

* Resolve permissions for Organization

* fix core endpoint issue (#21)

* fix core endpoint issue

* updated comment

* Updated environment variables

* Updated environment values

* Handle for Gateway response 400

* datamesh join:
- product <-> third party tool and
- product <-> product_team

* completed project tool service datamesh join

* completed release service datamesh join

* completed dev/partner service datamesh join

* Fix Datamesh request issue

* updated admin username and password

* revert find endpoint fix

* updated datamesh join module name

* Added script to load datamesh

* Handled blank response for join records

* datamesh POST/PUT request implementation

* updated post request for different use-cases

* datamesh implemented delete request

* post empty response validation

* updated datamesh script for pk

* converted into functions

* updated put request

* updated PUT request for case -> The relation that exists but needs to create join

* Allow users to be auto-approved after registration

* added fields on Relationship model

* model via forward lookup

* param service name via forward_lookup

* written function for the case - Handles The relation that only needs to update ID or UUID

* Get response after a POST and PUT request

* refactor the functions

* updated func parameter

* issue fix - delete join

* delete status join

* migration file

* User Type Implementation (#45)

* added user type

* admin dashboard

* added survey_status

* serializer fields added

* help text

* User profile update API (#48)

* user profile update API

* updated get_permission

* unit test cases

* added serializer field

* serializer organization_name validation

* updated core-user serializer update method

* User registration update (#53)

* register with org validation

* uncommented invitation_token method

* updated load initial script for org creation

* set auto approve to false

* core user create method

* default org name

* added new var to update

* code format

* updated gunicorn timeout

* Datamesh id CRUD Implementation (#56)

* create join with ID

* updated join script to create relation if json file doesn't exist

* added newly added var in script

* delete id join

* Fixed gateway unit test cases

* implemented forward and reverse relation join in PUT req

* refactored fk reference variable

* written module join script

* PUT request: modified prepare_update_request() fun

* Fix POST req reverse relation join

* updated relation model fields

* updated script variable

* unit tes case

* updated unit test cases

* updated join script

* Datamesh implementation with core (#59)

* implementation with core

* PUT request update fk value

* script info

* added Datamesh relation response data in POST and PUT request

* removed unused import

* RequestHandler returned response

* added core update req data to req response data

* Stripe integration for customer create and get card details (#62)

* initial stripe subscription changes

* add new stripe/products endpoint

* change plan to product for subscription

* add stripe check for update org for a user scenario

* Fixed unit test cases (#63)

* GitHub action configuration (#67)

* GitHub action configuration

* Updated prod-build GCR path

* Updated prod-build slack message

* Updated prod-build mail message

* Added Product Team as default user type (#65)

Co-authored-by: ashishkmishra36 <ashish.kumar@ajackus.com>
Co-authored-by: Ashish K Mishra <70134840+ashishkmishra36@users.noreply.github.com>
Co-authored-by: Yasmin Ansari <yasmin@ajackus.com>
Co-authored-by: mthombare <83965396+mthombare@users.noreply.github.com>
Co-authored-by: manish <manish.thombare@ajackus.com>
Co-authored-by: Yasmin Ansari <yasmin.ansari@ajackus.com>
Co-authored-by: Radhika Patel <radhika.patel@ajackus.com>

* Feat#113/upstream changes (#350)

* Update ISSUE_TEMPLATE.md

Add complexity estimate

* update travis configs

* update travis configs

* move build to travis script

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* update travis for aws

* cleanup initital data

* cleanup initital data

* cleanup initital data

* remove organization_name

* remove organization_name

* update travis var

* update travis var

* update travis var

* revert keys

* fix org

* fix org

* fix org

* fix org

* fix org

* fix org

* fix org

* turn off tagged commits for builds

* update docker compose with email host

* update docker compose with email host

* update docker compose with email host

* update docker compose with email host

* add options function to gateway

* update permissions with options

* refactor: Allow organization name to be accepted when creating core user

* chore: Update initial setup

* test: Refactored test cases for organization

* fix: Flake8 warnings

* Flake8 Error fixes

* chore: Flake8 fixes for whitespaces and f-strings

* chore: Resolved ContextualVersionConflict

* chore: requests dependency version

* Changes for Oauth in Initial Script

* removed changed in gateway view to allow options methid from service

* removed changed in gateway view to allow options methid from service

* Commenting out options function for options response of services

* email alert message for shipment to user

* Use generalised function name

* initial commit

* added seperate endpoint for update

* add more illutratative field in message

* remove commented code in html template of shipment alert

* modifify html template name to send email alert for shipment

* remove conflict

* Allow user to subscribe to email alert in Profile

* fixed linting

* changed shipment id to shipment_uuid

* added email_alert_flag to CoreUser Serializer

* fixed linting

* added boolean field in organisation

* Resolved issue in OPTIONS method via Core

* TransparentPath/issues/45:add radis field in organization

* Added support for multiple email alerts

* initial commit

* return only org names

* removed debugging info

* change in request format of email alert endpoint (#53)

* change in request format of email alert endpoint

* resolved flake-8 error

* Added consortium table and its endpoint (#50)

* added consortium table and its endpoint

* formatted as per flake8

* resolved falke8 error

* Added organization types (#56)

* Added organization type

* Formatting fixes

* Corrected test case

* Approval email for newly registered users (#57)

* Added organization type

* Formatting fixes

* Corrected test case

* Approval email for new users

* Resolved flake8 warnings

* Fixed issue in tests

* Resolved comments

* Updated email template for alerts

* Updated email template for alerts

* Organization names coming from open API as list of names (#60)

* Resolve permission issue for "/organization/fetch_orgs/" endpoint (#64)

* resolved permission issue for fetch_org endpoint

* resloved flake-8 error

* Add API endpoint for organization type (#65)

* resolved permission issue for fetch_org endpoint

* resloved flake-8 error

* add endpoint for organization type

* corrected comments

* change permission level

* add create and edit date in organization type

* change permission level to only organization admin

* Updated configuration for consortium (#70)

* Updated configuration for consortium

* Flake8 fixes

* Configuration for user alert preferences (#73)

* Configuration for user alert preferences

* Flake8 fixes

* Fixes in test cases

* update consortium table for organization uuid (#75)

* Modifications in email templates (#77)

* Changes in email template for environmental alerts

* Preferences for email alerts

* Updated super admin credentials

* change permission level for consortium table (#79)

* filter consortium by organization (#81)

* update consortium array field (#82)

* Changed permission level for consortium (#85)

* Changed permission level for consortium

* Updated flake8 fixes

* create consortium if custody create (#87)

* create consortium if custody create

* resolved flake8 error

* Fix issue for retrieve query by uuid (#88)

* Revert "Fix issue for retrieve query by uuid (#88)"

This reverts commit d2f78ef.

* Handled boolean for CORS_ORIGIN_ALLOW_ALL

* Updated Bravado Core version

* Return response data only for PUT, POST, DELETE (#97)

* Added default radius for organization

* Allow unlimited line size for request

* sensor service email alert for unassigned moving sensor (#105)

* squashed migration files

* construct shipment_url only when shipment_id is present

* remove shipment related from email if shipment is not available

* Handle when no custody organization mapped to custodian

* Environmental warning timezone. (#108)

* Change warning timezone to user's timezone only when core user has timezone

* append ('UTC') for UTC timezone

* Remove Travis

* Remove timestamp from alert messages (#110)

* removed 'Captured at' from alert message

* stop sending datetime in alert message

* Gunicorn timeout configuration

* added new line at the end of gunicorn_conf.py file

* added new line at the end of settings/base.py file

Co-authored-by: Greg Lind <gwlind@gmail.com>
Co-authored-by: Yasmin Ansari <yasmin@ajackus.com>
Co-authored-by: vishalajackus <vishal.hande@ajackus.com>
Co-authored-by: ashishkmishra36 <ashish.kumar@ajackus.com>
Co-authored-by: vishalajackus <73515569+vishalajackus@users.noreply.github.com>
Co-authored-by: Ashish K Mishra <70134840+ashishkmishra36@users.noreply.github.com>
Co-authored-by: mthombare <83965396+mthombare@users.noreply.github.com>
Co-authored-by: Yasmin Ansari <yasmin.ansari@ajackus.com>
Co-authored-by: RadhikaPPatel <radhika.patel@ajackus.com>

* Bump djangorestframework from 3.9.4 to 3.11.2 in /requirements (#352)

Bumps [djangorestframework](https://github.com/encode/django-rest-framework) from 3.9.4 to 3.11.2.
- [Release notes](https://github.com/encode/django-rest-framework/releases)
- [Commits](encode/django-rest-framework@3.9.4...3.11.2)

---
updated-dependencies:
- dependency-name: djangorestframework
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* clean code to run locally (#354)

* clean code to run locally

* debugging of docker and other issues

Co-authored-by: anamariaroman <anamariaromanvalencia@gmail.com>

* Update README.md (#355)

Adding vision and objectives

* Update README.md

* Update issue templates

* Merge with massive style changes that should not have been there

* remove secrets

* fix conflict

* fix conflict

* fix conflict

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Co-authored-by: Yasmin Ansari <yasmin@ajackus.com>
Co-authored-by: vishalajackus <vishal.hande@ajackus.com>
Co-authored-by: ashishkmishra36 <ashish.kumar@ajackus.com>
Co-authored-by: vishalajackus <73515569+vishalajackus@users.noreply.github.com>
Co-authored-by: Ashish K Mishra <70134840+ashishkmishra36@users.noreply.github.com>
Co-authored-by: mthombare <83965396+mthombare@users.noreply.github.com>
Co-authored-by: Yasmin Ansari <yasmin.ansari@ajackus.com>
Co-authored-by: abhishek-kumar-piyush <97152893+abhishek-kumar-piyush@users.noreply.github.com>
Co-authored-by: RadhikaPPatel <radhika.patel@ajackus.com>
Co-authored-by: Radhika Patel <radhika.patel2206@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: JiseonYu <jiseon477@gmail.com>
Co-authored-by: Jeferson Moura <jefmoura@users.noreply.github.com>
Co-authored-by: jefmoura <jefmoura@protonmail.com>
Co-authored-by: karrla <15875770+karrla@users.noreply.github.com>
Co-authored-by: manish <manish.thombare@ajackus.com>
Co-authored-by: Peter Odeny <odenypeter@gmail.com>
Co-authored-by: anamariaroman <anamariaromanvalencia@gmail.com>
  • Loading branch information
20 people committed Apr 5, 2024
1 parent d991e10 commit f680df8
Show file tree
Hide file tree
Showing 108 changed files with 4,137 additions and 1,774 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/demo-build.yml
@@ -0,0 +1,27 @@
name: Build and Push to Demo

on:
push:
branches:
- demo
jobs:
build:
name: Build and Push to GCR
runs-on: ubuntu-latest
env:
IMAGE_NAME: gcr.io/spry-bricolage-298920/transparent-path/demo/buildly-core
steps:
- uses: actions/checkout@v2

- name: Docker login
uses: docker/login-action@v1
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}

- name: Build docker image
run: docker build -t $IMAGE_NAME:latest .

- name: Push to Google Container Registry
run: docker push $IMAGE_NAME:latest
5 changes: 5 additions & 0 deletions .github/workflows/dev-build.yml
Expand Up @@ -3,7 +3,12 @@ name: Build and Push to Development
on:
push:
branches:
<<<<<<< HEAD
- dev

=======
- master
>>>>>>> master
jobs:
build:
name: Build and Push to GCR
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: no-commit-to-branch
args: [--branch, prod, --branch, demo, --branch, dev]
5 changes: 4 additions & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM python:3.7-alpine3.10
FROM --platform=linux/amd64 python:3.7-alpine3.10

# Do not buffer log messages in memory; some messages can be lost otherwise
ENV PYTHONUNBUFFERED 1
Expand All @@ -21,5 +21,8 @@ RUN ./scripts/collectstatic.sh

RUN apk del .build-deps

# Specify tag name to be created on github
LABEL version="1.0.10"

EXPOSE 8080
ENTRYPOINT ["bash", "/code/scripts/docker-entrypoint.sh"]
33 changes: 30 additions & 3 deletions buildly/management/commands/loadinitialdata.py
Expand Up @@ -5,8 +5,21 @@
from django.core.management.base import BaseCommand
from django.db import transaction

<<<<<<< HEAD
from core.models import (
ROLE_VIEW_ONLY,
ROLE_ORGANIZATION_ADMIN,
ROLE_WORKFLOW_ADMIN,
ROLE_WORKFLOW_TEAM,
Organization,
CoreUser,
CoreGroup,
OrganizationType,
)
=======
from core.models import ROLE_VIEW_ONLY, ROLE_ORGANIZATION_ADMIN, ROLE_WORKFLOW_ADMIN, ROLE_WORKFLOW_TEAM, \
Organization, CoreUser, CoreGroup, OrganizationType
>>>>>>> master

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -34,13 +47,19 @@ def _create_organization_types(self):

def _create_default_organization(self):
if settings.DEFAULT_ORG:
self._default_org, _ = Organization.objects.get_or_create(name=settings.DEFAULT_ORG)
self._default_org, _ = Organization.objects.get_or_create(
name=settings.DEFAULT_ORG
)

def _create_groups(self):
self._su_group = CoreGroup.objects.filter(is_global=True, permissions=15).first()
self._su_group = CoreGroup.objects.filter(
is_global=True, permissions=15
).first()
if not self._su_group:
logger.info("Creating global CoreGroup")
self._su_group = CoreGroup.objects.create(name='Global Admin', is_global=True, permissions=15)
self._su_group = CoreGroup.objects.create(
name='Global Admin', is_global=True, permissions=15
)

# TODO: remove this after full Group -> CoreGroup refactoring
self._groups.append(Group.objects.get_or_create(name=ROLE_VIEW_ONLY))
Expand All @@ -56,7 +75,15 @@ def _create_user(self):
logger.info("Creating Super User")
user_password = None
if settings.DEBUG:
<<<<<<< HEAD
user_password = (
settings.SUPER_USER_PASSWORD
if settings.SUPER_USER_PASSWORD
else 'zGtkgLvmNiKm'
)
=======
user_password = settings.SUPER_USER_PASSWORD if settings.SUPER_USER_PASSWORD else 'zGtkgLvmNiKm'
>>>>>>> master
elif settings.SUPER_USER_PASSWORD:
user_password = settings.SUPER_USER_PASSWORD
else:
Expand Down
66 changes: 39 additions & 27 deletions buildly/settings/authentication.py
Expand Up @@ -31,7 +31,7 @@
# Rest Framework OAuth2 and JWT
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] += [
'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
'oauth2_provider_jwt.authentication.JWTAuthentication'
'oauth2_provider_jwt.authentication.JWTAuthentication',
]

# Auth Application
Expand All @@ -50,28 +50,25 @@
AUTH_PASSWORD_VALIDATORS = []

AUTH_PASSWORD_VALIDATORS_MAP = {
'USE_PASSWORD_USER_ATTRIBUTE_SIMILARITY_VALIDATOR':
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
'USE_PASSWORD_MINIMUM_LENGTH_VALIDATOR':
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'OPTIONS': {
'min_length': int(os.getenv('PASSWORD_MINIMUM_LENGTH', 6)),
}
},
'USE_PASSWORD_COMMON_VALIDATOR':
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
'USE_PASSWORD_NUMERIC_VALIDATOR':
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
'USE_PASSWORD_USER_ATTRIBUTE_SIMILARITY_VALIDATOR': {
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'
},
'USE_PASSWORD_MINIMUM_LENGTH_VALIDATOR': {
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'OPTIONS': {'min_length': int(os.getenv('PASSWORD_MINIMUM_LENGTH', 6))},
},
'USE_PASSWORD_COMMON_VALIDATOR': {
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'
},
'USE_PASSWORD_NUMERIC_VALIDATOR': {
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'
},
}

for password_validator_env_var, password_validator in AUTH_PASSWORD_VALIDATORS_MAP.items():
for (
password_validator_env_var,
password_validator,
) in AUTH_PASSWORD_VALIDATORS_MAP.items():
if os.getenv(password_validator_env_var, 'True') == 'True':
AUTH_PASSWORD_VALIDATORS.append(password_validator)

Expand All @@ -81,11 +78,13 @@
SOCIAL_AUTH_URL_NAMESPACE = 'social'
SOCIAL_AUTH_POSTGRES_JSONFIELD = True

SOCIAL_AUTH_REDIRECT_IS_HTTPS = True if os.getenv('SOCIAL_AUTH_REDIRECT_IS_HTTPS') == 'True' else False
SOCIAL_AUTH_REDIRECT_IS_HTTPS = (
True if os.getenv('SOCIAL_AUTH_REDIRECT_IS_HTTPS') == 'True' else False
)
SOCIAL_AUTH_LOGIN_REDIRECT_URLS = {
'github': os.getenv('SOCIAL_AUTH_GITHUB_REDIRECT_URL', None),
'google-oauth2': os.getenv('SOCIAL_AUTH_GOOGLE_OAUTH2_REDIRECT_URL', None),
'microsoft-graph': os.getenv('SOCIAL_AUTH_MICROSOFT_GRAPH_REDIRECT_URL', None)
'microsoft-graph': os.getenv('SOCIAL_AUTH_MICROSOFT_GRAPH_REDIRECT_URL', None),
}

SOCIAL_AUTH_PIPELINE = (
Expand Down Expand Up @@ -117,9 +116,18 @@
# i.e. ['example.com', 'buildly.io','treeaid.org']
if os.getenv('SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS'):
SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS = os.getenv(
<<<<<<< HEAD
'SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS'
).split(',')
'SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS').split(',')

=======
'SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS').split(',')
>>>>>>> master
if os.getenv('SOCIAL_AUTH_MICROSOFT_WHITELISTED_DOMAINS'):
SOCIAL_AUTH_GOOGLE_MICROSOFT_DOMAINS = os.getenv('SOCIAL_AUTH_MICROSOFT_WHITELISTED_DOMAINS').split(',')
SOCIAL_AUTH_GOOGLE_MICROSOFT_DOMAINS = os.getenv(
'SOCIAL_AUTH_MICROSOFT_WHITELISTED_DOMAINS'
).split(',')

# oauth2 settings
OAUTH2_PROVIDER = {
Expand All @@ -132,7 +140,9 @@
}

DEFAULT_OAUTH_DOMAINS = os.getenv('DEFAULT_OAUTH_DOMAINS', '')
CREATE_DEFAULT_PROGRAM = True if os.getenv('CREATE_DEFAULT_PROGRAM') == 'True' else False
CREATE_DEFAULT_PROGRAM = (
True if os.getenv('CREATE_DEFAULT_PROGRAM') == 'True' else False
)

# LDAP configuration
# https://django-auth-ldap.readthedocs.io/en/latest/reference.html#settings
Expand All @@ -147,7 +157,7 @@
AUTH_LDAP_USER_SEARCH = LDAPSearch(
AUTH_LDAP_BASE_DN,
ldap.SCOPE_SUBTREE,
f'{AUTH_LDAP_USERNAME_FIELD_SEARCH}=%(user)s'
f'{AUTH_LDAP_USERNAME_FIELD_SEARCH}=%(user)s',
)

AUTH_LDAP_USER_ATTR_MAP = {
Expand All @@ -157,4 +167,6 @@
'email': 'mail',
}
AUTH_LDAP_ALWAYS_UPDATE_USER = True
AUTH_LDAP_CACHE_TIMEOUT = 3600 # Cache distinguished names and group memberships for an hour to minimize
AUTH_LDAP_CACHE_TIMEOUT = (
3600
) # Cache distinguished names and group memberships for an hour to minimize
60 changes: 19 additions & 41 deletions buildly/settings/base.py
@@ -1,8 +1,7 @@
import os

# Base dir path
BASE_DIR = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

SECRET_KEY = os.environ['SECRET_KEY']

Expand All @@ -20,9 +19,7 @@

STATIC_URL = '/static/'

STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]


INSTALLED_APPS_DJANGO = [
Expand All @@ -40,31 +37,23 @@
'django_filters',
'rest_framework',
'rest_framework.authtoken',

# Social auth
'social_django',

# OAuth2
'oauth2_provider',
'oauth2_provider_jwt',

# swagger
'drf_yasg',

# health check
'health_check', # required
'health_check.db', # stock Django health checkers
'health_check', # required
'health_check.db', # stock Django health checkers
]

INSTALLED_APPS_LOCAL = [
'buildly',
'gateway',
'core',
'workflow',
'datamesh',
]
INSTALLED_APPS_LOCAL = ['buildly', 'gateway', 'core', 'workflow', 'datamesh']

INSTALLED_APPS = INSTALLED_APPS_DJANGO + INSTALLED_APPS_THIRD_PARTIES + INSTALLED_APPS_LOCAL
INSTALLED_APPS = (
INSTALLED_APPS_DJANGO + INSTALLED_APPS_THIRD_PARTIES + INSTALLED_APPS_LOCAL
)

MIDDLEWARE_DJANGO = [
'django.middleware.security.SecurityMiddleware',
Expand All @@ -76,13 +65,9 @@
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

MIDDLEWARE_CSRF = [
'core.middleware.DisableCsrfCheck',
]
MIDDLEWARE_CSRF = ['core.middleware.DisableCsrfCheck']

EXCEPTION_MIDDLEWARE = [
'core.middleware.ExceptionMiddleware'
]
EXCEPTION_MIDDLEWARE = ['core.middleware.ExceptionMiddleware']

MIDDLEWARE = MIDDLEWARE_DJANGO + MIDDLEWARE_CSRF + EXCEPTION_MIDDLEWARE

Expand All @@ -91,9 +76,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
'templates',
],
'DIRS': ['templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand All @@ -106,10 +89,10 @@
'social_django.context_processors.login_redirect',
],
'builtins': [ # TODO to delete?
'django.contrib.staticfiles.templatetags.staticfiles',
'django.contrib.staticfiles.templatetags.staticfiles'
],
},
},
}
]

WSGI_APPLICATION = 'buildly.wsgi.application'
Expand Down Expand Up @@ -171,17 +154,17 @@
'rest_framework.authentication.SessionAuthentication', # TODO check if disable, and also delete CSRF
'rest_framework.authentication.TokenAuthentication',
],
'DEFAULT_PERMISSION_CLASSES': (
'core.permissions.IsSuperUserBrowseableAPI',
)
'DEFAULT_PERMISSION_CLASSES': ('core.permissions.IsSuperUserBrowseableAPI',)
# ToDo: Think about `DEFAULT_PAGINATION_CLASS as env variable and
# customizable values with reasonable defaults
}

# Front-end application URL
FRONTEND_URL = os.getenv('FRONTEND_URL', 'http://www.example.com/')
REGISTRATION_URL_PATH = os.getenv('REGISTRATION_URL_PATH', 'register/')
RESETPASS_CONFIRM_URL_PATH = os.getenv('RESETPASS_CONFIRM_URL_PATH', 'reset_password_confirm/')
RESETPASS_CONFIRM_URL_PATH = os.getenv(
'RESETPASS_CONFIRM_URL_PATH', 'reset_password_confirm/'
)

PASSWORD_RESET_TIMEOUT_DAYS = 1

Expand All @@ -197,11 +180,6 @@

# Swagger settings - for generate_swagger management command

SWAGGER_SETTINGS = {
'DEFAULT_INFO': 'gateway.urls.swagger_info',
}
SWAGGER_SETTINGS = {'DEFAULT_INFO': 'gateway.urls.swagger_info'}

ORGANIZATION_TYPES = [
'Custodian',
'Producer'
]
ORGANIZATION_TYPES = ['Custodian', 'Producer']

0 comments on commit f680df8

Please sign in to comment.