Skip to content
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

Feature/project ownership #346

Merged
merged 43 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e95edea
add projects collection, link to user and folder
teemukataja Jan 28, 2022
a3f3d8f
refactor ownership checking
teemukataja Feb 2, 2022
131c4a4
fix mypy type hint on mongo query object
teemukataja Feb 2, 2022
c974da7
Add filename extraction for objects created from file
genie9 Jan 26, 2022
9149bb6
Add folder patching on object creation
genie9 Jan 26, 2022
04ecce3
Update swagger doc
genie9 Jan 26, 2022
9a78733
Add mypy linting checker for VSCode
genie9 Jan 26, 2022
d557d92
Extract title of object for folder patch
genie9 Feb 9, 2022
8c23e05
Add CSV to submission type check
genie9 Feb 9, 2022
4c23156
Add patching of folder after object update and replace
genie9 Feb 9, 2022
77d3ddb
Update integration tests with folder check for metadata and draft obj…
genie9 Feb 10, 2022
f17496a
Add 'CSV' as accepted submission type
genie9 Feb 11, 2022
48fb095
Update changelog
genie9 Feb 14, 2022
197bd9f
Merge pull request #341 from CSCfi/refactor/patch-object-on-save
blankdots Feb 14, 2022
b8a4860
Bump pytest from 7.0.0 to 7.0.1
dependabot[bot] Feb 14, 2022
2f41465
Bump pip-tools from 6.5.0 to 6.5.1
dependabot[bot] Feb 14, 2022
7b82526
Merge pull request #351 from CSCfi/dependabot/pip/develop/pytest-7.0.1
genie9 Feb 14, 2022
fe06672
Merge pull request #352 from CSCfi/dependabot/pip/develop/pip-tools-6…
genie9 Feb 14, 2022
47e07a3
Merge branch 'develop' into feature/project-ownership
teemukataja Feb 15, 2022
e9b98b3
fix rebase conflicts
teemukataja Feb 15, 2022
fea7e1a
deprecate user ownership functions
teemukataja Feb 15, 2022
4f4453f
update changelog
teemukataja Feb 15, 2022
bc71bd8
make project check in auth more reliable
teemukataja Feb 15, 2022
7c5612e
update wordlist
teemukataja Feb 15, 2022
00cec8f
update integration tests and code respectively, deprecate some features
teemukataja Feb 16, 2022
99e03a0
remove some deprecated code, add deprecation flags to uncertain bits …
teemukataja Feb 16, 2022
6830c2e
fix typo and update part of api spec
teemukataja Feb 16, 2022
2202e3b
add deprecation notes for later pruning, remove some deprecated featu…
teemukataja Feb 17, 2022
19b0f12
fix mypy and spellcheck
teemukataja Feb 17, 2022
890fbff
add templates-endpoint
teemukataja Feb 23, 2022
a523f65
remove deprecations
teemukataja Feb 23, 2022
500af51
Merge branch 'develop' into feature/project-ownership
teemukataja Feb 23, 2022
bbf9cb0
add templates endpoints to api spec
teemukataja Feb 23, 2022
5c08690
add templates endpoint request to integration tests
teemukataja Feb 23, 2022
80479a7
fix function docstring
teemukataja Feb 23, 2022
8ac6604
check folder ownership when posting an object
teemukataja Feb 24, 2022
48a927f
refactor templates to be listed under projects using old object assig…
teemukataja Feb 28, 2022
829f5a1
remove projectid requirement from template deletion
teemukataja Feb 28, 2022
1a20918
Merge branch 'develop' into feature/project-ownership
teemukataja Feb 28, 2022
48cdb68
remove deprecated user patch
teemukataja Mar 1, 2022
21f69af
fix separate template list updating in project-collection
teemukataja Mar 1, 2022
b743891
add new word
teemukataja Mar 1, 2022
02a7913
remove project check, already done in aai, unreachable code
teemukataja Mar 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/config/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ cscfi
cscusername
csi
csrf
csv
ctrl
cts
curation
Expand Down Expand Up @@ -388,6 +389,7 @@ nlmcatalog
noindex
nominallength
nominalsdev
noproject
northboundlatitude
novaseq
npm
Expand Down Expand Up @@ -462,6 +464,8 @@ primaryid
probeset
processedreads
processingtype
projectId
projectNumber
promethion
proteinclusters
protfam
Expand Down Expand Up @@ -532,6 +536,7 @@ schemeuri
scientificname
sda
sdev
sdSubmitProjects
se
secondaryid
sectionname
Expand Down Expand Up @@ -651,4 +656,4 @@ xsd
yaml
yml
za
zhuang
zhuang
139 changes: 75 additions & 64 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- templates API #256
- Add patching of folders after object save and update operations
- Object is added or updated to folder(submission) where it belongs with it's accession ID, schema, submission type, title and filename in the case of CSV and XML upload
- Adds configuration for mypy linting to VScode devcontainer setup
- Templates API #256
- use `ujson` as default json library
- creating draft Datacite DOI for folders #257
- Creating draft Datacite DOI for folders #257
- created a mock web app, which would act similarly to DataCite REST API
- altered `publish_folder` endpoint so that `extraInfo` containing the DOI data is added upon publishing
- added `datePublished` key to folders which takes in the date/time, when folder is published
Expand All @@ -26,37 +29,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- update github actions
- Add folder querying by date #308
- Add description to JSON schemas #323

- add JSON schema spelling checker to pyspelling github action
- optimise wordlist by adding regex ignore patterns
- added pyspelling to pre-commit hooks (fixed syntax for scripts according to https://github.com/koalaman/shellcheck )
- enum are sorted alphabetically, with the exception of other and unspecified values which are left at the end of the list
- allow for accession key in `referenceAlignment` & `process sequence` as array, previously all accession keys were converted to `accessionId` which is not correct
- add default `gender` as `unknown`

- Project ownership #346 --DRAFT
- deprecated `folders` and `templates` keys from `GET /users/current`
- as a side effect, deprecated `items` query parameter from the same endpoint
- added new collection `project`
- added new key `projects` to `user`
- added new key `projectId` to `folder` and `template-*`
- new mandatory `/userinfo` value from AAI at login time `sdSubmitProjects`
- user is redirected to `/noproject` if key is empty or missing
- new mandatory query parameter `projectId` in `GET /folders`
- new mandatory JSON key `projectId` in `POST /folders` and `POST /templates`
- new endpoint `GET /templates` to replace `GET /users/current` `{"templates":[...]}`
- WARNING: breaking change that requires fresh database, because "project" is new information that did not exist before, and it can't be migrated to existing user-owned hierarchy

### Changed

- Refactor auth.py package by removing custom OIDC code and replacing it with https://github.com/IdentityPython/JWTConnect-Python-OidcRP. #315
- New mandatory ENV `OIDC_URL`
- New optional ENVs `OIDC_SCOPE`, `AUTH_METHOD`
- Added oidcrp dependency
- use node 16+ #345
- Use node 16+ #345
- VScode Dev environment #287
- Adds requirements-dev.in/txt files. Now pip dependencies can be managed with pip-tools
- README updated with tox command, development build instructions, and prettify Dockerfile.
- update ENA XML and JSON schemas #299
- Update ENA XML and JSON schemas #299
- Github actions changed the use of https://git.io/misspell to rojopolis/spellcheck-github-actions #316
- Separated most of the handlers to own files inside the handlers folder #319

### Fixed

- coveralls report #267
- typos for functions and tests #279
- fix spelling mistakes for JSON schemas #323
- oidcrp does not allow empty values, prefill them in mockauth so front-end can start #333
- Coveralls report #267
- Typos for functions and tests #279
- Fix spelling mistakes for JSON schemas #323
- Oidcrp does not allow empty values, prefill them in mockauth so front-end can start #333
- Fix development environment #336

- Add env vars OIDC_URL and OIDC_URL_TEST to mock auth container
- Adds logging configs for mock auth
- Updates mock auth api's token endpoint with expiration configs
Expand All @@ -76,7 +88,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- package updates
- Package updates

### Added

Expand All @@ -88,72 +100,71 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- add integration tests for misses in dataset, experiment, policy
- Add integration tests for misses in dataset, experiment, policy

### Changed

- package updates
- Package updates
- EGA XML schemas version:1.8.0
- refactor analysis and experiment schemas to adhere to XML schema
- Refactor analysis and experiment schemas to adhere to XML schema

### Fixed

- fix misses for DAC, experiment and policy processing of XML
- fix misses in JSON Schema
- Fix misses for DAC, experiment and policy processing of XML
- Fix misses in JSON Schema

## [0.9.0] - 2021-03-22

### Added

- use dependabot
- support simultaneous sessions
- Use dependabot
- Support simultaneous sessions

### Changed

- Refactor JSON schema Links
- refactor handlers to be more streamlined
- validate patch requests for JSON content
- switch to python 3.8
- Refactor handlers to be more streamlined
- Validate patch requests for JSON content
- Switch to python 3.8

## [0.8.1] - 2021-02-15

### Fixed

- bugfix for error pages #202
- Bugfix for error pages #202

## [0.8.0] - 2021-02-12

### Added

- TLS support
- use `sub` as alternative to `eppn` to identify users
- Use `sub` as alternative to `eppn` to identify users
- `PATCH` for objects and `PUT` for XML objects enabled
- delete folders and objects associated to user on user delete
- Delete folders and objects associated to user on user delete

### Changed

- redirect to error pages
- extended integration tests
- Redirect to error pages
- Extended integration tests

### Fixed

- fix replace on json patch
- general bug and fixes
- Fix replace on json patch
- General bug and fixes

## [0.7.1] - 2021-01-19

### Fixed

- hotfix release #176

- Hotfix release #176
- added check_object_exists to check object exists and fail early with 404 before checking it belongs to user
- refactor and added more check_folder_exists to check folder exists before doing anything
- integration test to check objects are deleted properly

### Changes

- check objects and folders exist before any operation
- integration check to see if deleted object or folder are still registered in db
- Check objects and folders exist before any operation
- Integration check to see if deleted object or folder are still registered in db

## [0.7.0] - 2021-01-06

Expand All @@ -162,25 +173,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- CodeQL github action #162
- `/health` endpoint #173

- map `users` to `folders` with `_handle_check_ownedby_user` #158
- Map `users` to `folders` with `_handle_check_ownedby_user` #158
- querying for objects is restricted to only the objects that belong to user
- return folders owned by user or published
- added a few db operators some used (aggregate, remove)
- process json patch to mongo query so that there is addition and replace instead of full rewrite of the document causing race condition
- standardise raises description and general improvements and fixes of logs and descriptions

### Changed
- verify `/publish` endpoint #163
- restrict endpoints to logged in users #151
- updated documentation #165
- switch to using uuids for accession ids #168
- integration tests and increase unit test coverage #166
- Verify `/publish` endpoint #163
- Restrict endpoints to logged in users #151
- Updated documentation #165
- Switch to using uuids for accession ids #168
- Integration tests and increase unit test coverage #166

### Fixed

- fixes for idp and location headers redirects #150
- fix race condition in db operations #158
- fix handling of draft deletion by removing redundant deletion #164, #169 and #172
- Fixes for idp and location headers redirects #150
- Fix race condition in db operations #158
- Fix handling of draft deletion by removing redundant deletion #164, #169 and #172

## [0.6.1] - 2020-11-23

Expand All @@ -190,38 +201,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- refactor draft `/folder` #144
- refactor gh actions #140
- patch publish #141
- Refactor draft `/folder` #144
- Refactor gh actions #140
- Patch publish #141

### Fixed

- bugfixes for login redirect #139
- Bugfixes for login redirect #139

## [0.6.0] - 2020-10-08

### Added

- authentication with OIDC #133
- only 3.7 support going further #134
- more submission actions `ADD` and `MODIFY` #137
- Authentication with OIDC #133
- Only 3.7 support going further #134
- More submission actions `ADD` and `MODIFY` #137


## [0.5.3] - 2020-08-21

### Changed

- updated OpenAPI specifications #127
- python modules, project description and instructions to documentation sources #128
- added integration tests #129
- updated documentation #130
- Updated OpenAPI specifications #127
- Python modules, project description and instructions to documentation sources #128
- Added integration tests #129
- Updated documentation #130


## [0.5.2] - 2020-08-14

### Fixes

- fix mimetype for SVG image and package data
- Fix mimetype for SVG image and package data

## [0.5.1] - 2020-08-14

Expand All @@ -233,10 +244,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixes

- Dockerfile build fixes #115
- fix JSON Schema details #117
- missing env from github actions #119
- typo fixes #120
- await responses #122
- Fix JSON Schema details #117
- Missing env from github actions #119
- Typo fixes #120
- Await responses #122


## [0.5.0] - 2020-08-06
Expand All @@ -250,28 +261,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- JSON validation
- XML better parsing
- Auth middleware
- pagination
- Pagination

### Changed

- Improved current naming conventions #82
- Login flow with new routes for Home & Login #76, #79, #80
- change from pymongo to motor
- Change from pymongo to motor

## [0.2.0] - 2020-07-01

### Added

- Added integration tests
- switched to github actions
- added base docs folder
- added more refined XML parsing
- Switched to github actions
- Added base docs folder
- Added more refined XML parsing
- Integration tests added
- Refactor unit tests

### Changed

- refactor API endpoints and responses
- Refactor API endpoints and responses
- error using https://tools.ietf.org/html/rfc7807
- `objects` and `schemas` endpoints added

Expand Down
Loading