From 547a9513af943f95805c22d893864c9861ffd2ed Mon Sep 17 00:00:00 2001 From: tsande16 Date: Fri, 15 Nov 2024 16:37:36 -0500 Subject: [PATCH 1/5] Update top-level README - Modify project README with brief summary and URLS pointing to user docs - Delete all sub-READMEs --- README.md | 236 +-------------------- pass-core-doi-service/README.md | 44 ---- pass-core-file-service/README.md | 59 ------ pass-core-metadataschema-service/README.md | 85 -------- pass-core-policy-service/README.md | 12 -- pass-core-user-service/README.md | 26 --- 6 files changed, 8 insertions(+), 454 deletions(-) delete mode 100644 pass-core-doi-service/README.md delete mode 100644 pass-core-file-service/README.md delete mode 100644 pass-core-metadataschema-service/README.md delete mode 100644 pass-core-policy-service/README.md delete mode 100644 pass-core-user-service/README.md diff --git a/README.md b/README.md index 9b4a12e2..5d848cdb 100644 --- a/README.md +++ b/README.md @@ -1,230 +1,10 @@ -# Introduction +# PASS Core -This module is a Spring Boot application which provides the PASS REST API. +PASS Core is the central backend service within the PASS application that manages the core data model. It provides an +Elide JSON:API based interface to handle essential entities, including submissions, users, repositories, and policies. +Both the UI and backend services interact with the data model using JSON:API. PASS core is responsible for access +control and authorization, event handling and notifications. -# Building - -Java 17 and Maven 3.8 required. - -``` -mvn clean install -``` - -This will produce an executabler jar `pass-core-main/target/pass-core-main--exec.jar` and a docker image `ghcr.io/eclipse-pass/pass-core-main`. - -# Running local build - -After you have run `mvn clean install`, execute the following command from the `pass-core-main` directory: - -``` -java -Dspring.config.import=file:./src/test/resources/application-test.yml -jar target/pass-core-main--exec.jar -``` - -This command will use the configuration defined in the `pass-core-main/src/test/resources/application-test.yml` file. **This configuration should not be used in production, it is only meant for testing purposes.** - -Look at http://localhost:8080/swagger/ to see the auto-created documentation and a UI for testing out the api. - -You can directly make request with the UI and see what happens. Note when doing a POST to create an object, be sure to edit the type field to have the correct object type and delete the id field to have the id auto-generated. - -## Running with Docker - -Run `mvn clean install`. Then go to the [pass-docker](https://github.com/eclipse-pass/pass-docker) repository and following the instructions for starting a local environment. - -# Configuration - -The application is configured by its application.yaml which in turn references a number of environment variables. - -By default, pass-core-main will run with a typical production configuration. In order to run the default configuration, the environment variables below must be set with appropriate values for your environment. - -Environment variables: -| Environment Variable | Default Value | Description | -|--------------------------------------------------|------------------------------|-------------------------------------------------------------------------------------------------------------------------| -| `PASS_CORE_APP_LOCATION` | classpath:app/ | Location where requests are resolved | -| `PASS_CORE_DATABASE_URL` | | Connection URL to database | -| `PASS_CORE_DATABASE_USERNAME` | | Username for database login | -| `PASS_CORE_DATABASE_PASSWORD` | | Password for database login | -| `PASS_CORE_PORT` | | The port to expose for pass-core API | -| `PASS_CORE_LOG_DIR` | ${java.io.tmpdir}/pass-core | Path to log directory | -| `PASS_CORE_USER` | | Default user name for pass-core | -| `PASS_CORE_PASSWORD` | | Default user password for pass-core | -| `PASS_CORE_USE_SQS` | true | Flag to use AWS SQS for messaging | -| `PASS_CORE_EMBED_JMS_BROKER` | false | Flag to use Embedded ActiveMQ for messaging | -| `PASS_CORE_SUBMISSION_QUEUE` | pass-submission | Name of submission queue | -| `PASS_CORE_DEPOSIT_QUEUE` | pass-deposit | Name of deposit queue | -| `PASS_CORE_SUBMISSION_EVENT_QUEUE` | pass-submission-event | Name of submission event queue | -| `PASS_CORE_SP_ID` | | SAML SP ID [SAML configuration](#saml-configuration) | -| `PASS_CORE_SP_ACS` | | SAML SP ACS [SAML configuration](#saml-configuration) | -| `PASS_CORE_SP_KEY` | | Location of SAML SP private key pem file [SAML configuration](#saml-configuration) | -| `PASS_CORE_SP_CERT` | | Location of SAML SP public certificate pem file [SAML configuration](#saml-configuration) | -| `PASS_CORE_IDP_METADATA` | | Location of SAML IDM Metadata file [SAML configuration](#saml-configuration) | -| `PASS_CORE_APP_CSP` | | The Content Security Policy definition | -| `PASS_CORE_DEAULT_LOGIN_SUCCESS` | | Path to redirect to after login success [SAML configuration](#saml-configuration) | -| `PASS_CORE_LOGIN_PROCESSING_PATH` | | Path to handle login from SAML IDP [SAML configuration](#saml-configuration) | -| `PASS_CORE_LOGOUT_SUCCESS` | | Path to redirect to after SAML logout [SAML configuration](#saml-configuration) | -| `PASS_CORE_LOGOUT_DELETE_COOKIES` | | Name of cookies to delete as part of SAML logout [SAML configuration](#saml-configuration) | -| `PASS_CORE_USERTOKEN_KEY` | | If not present, one is generated. See the [user service](pass-core-user-service/README.md) for how to create manually. | -| `PASS_CORE_JAVA_OPTS` | | Used by the Docker image to pass arguments to Java. | -| `PASS_CORE_BASE_URL` | | Used when services send URLs to the client such as relationship links. | -| `PASS_CORE_FILE_SERVICE_TYPE` | FILE_SYSTEM | The type of File Service, FILE_SYSTEM or S3 | -| `PASS_CORE_FILE_SERVICE_ROOT_DIR` | | Path to File Service root directory | -| `PASS_CORE_S3_BUCKET_NAME` | pass-core-file | If File Service is S3, the S3 bucket name | -| `PASS_CORE_S3_REPO_PREFIX` | pass-core-file | If File Service is S3, the prefix of S3 keys in the bucket | -| `PASS_CORE_POLICY_INSTITUTION` | | Name of the institution | -| `PASS_CORE_POLICY_INSTITUTIONAL_POLICY_TITLE` | | Title of the institutional policy | -| `PASS_CORE_POLICY_INSTITUTIONAL_REPOSITORY_NAME` | | Name of institutional repository | - -The liquibase changelog located `pass-core-main/src/main/resources/db/changelog/changelog.yaml` will create the pass-core database schema if needed. - -If `PASS_CORE_USE_SQS` is `true`, then pass-core will attempt to connect to Amazon SQS. For testing purposes, you can set `AWS_REGION`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY` for connecting to AWS resources. In production, AWS IAM Service Roles should be used. - -Otherwise, a connection to an ActiveMQ broker can be configured by setting `SPRING_ACTIVEMQ_BROKER_URL`. If `PASS_CORE_EMBED_JMS_BROKER` is true, then an embedded ActiveMQ broker will be started -using that url. This can be useful to set tcp transport for connecting containers in a docker environment. The default is an embedded broker using vm transport. - -**Note you can quickly start pass-core locally for testing purposes following the instructions in [Running local build](#running-local-build) section.** - -# Access control - -SAML 2.0 and HTTP basic authentication are supported. An authenticated user is either authorized with a `BACKEND` or `SUBMITTER` role. - -A user that does a SAML login is mapped to a PASS user using locator ids. The provided SAML properties of the user -are interpreted using the spring property `pass.auth.attribute-map`. The user is assigned the `SUBMITTER` role. - -There is a single `BACKEND` user specified which can be logged in as using HTTP basic. - -The `BACKEND` role can do everything. The `SUBMITTER` role is restricted to creating and modifying certain objects in the data model. -The `SUBMITTER` has full access to all other services. - -# SAML configuration - -The `PASS_CORE_SP_KEY` and `PASS_CORE_SP_CERT` environment variables set the location of the keys used by pass-core to encrypt SAML communication. -Use `PASS_CORE_SP_ID` to set the identifier of the pass-core SP, `PASS_CORE_IDP_METADATA` to set the location where IDP metadata can be retrieved, -`PASS_CORE_SP_ACS` for the Assertion Consumer Service of the SP and `PASS_CORE_LOGIN_PROCESSING_PATH` to set the path for handling login from the IDP. -Note that `PASS_CORE_SP_ACS` is a URL which must match the path specified in `PASS_CORE_LOGIN_PROCESSING_PATH`. - -The `application-test.yml` configuration is set such that the integration tests can run against a [SimpleSAMLphp based IDP](https://github.com/kenchan0130/docker-simplesamlphp/) using resources included in `saml2/`. These defaults should not be used in production. - -The image can be run with: -``` -docker run --name=idp -p 8090:8080 -e SIMPLESAMLPHP_SP_ENTITY_ID=https://sp.pass/shibboleth -e SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE=http://localhost:8080/login/saml2/sso/pass -e SIMPLESAMLPHP_IDP_BASE_URL=http://localhost:8090/ -v ./pass-core/pass-core/main/src/test/resources/saml2/authsources.php:/var/www/simplesamlphp/config/authsources.php -d kenchan0130/simplesamlphp -``` -Note the volume mount which is set the user information appropriately for PASS. - -# CSRF protection - -Requests which have side effects (not a GET, HEAD, or OPTIONS and any request to /doi) are protected from CSRF through the use of a token. The client must provide a cookie XSRF-TOKEN and set a header X-XSRF-TOKEN to the same value. Clients can use any value they want. Browser clients will have the cookie value set by responses and so must first make a non-protected request. - -# App service - -The PASS application is available at `/app/` and `/` is redirected to `/app/`. Requests are resolved against the location given by the environment variable `PASS_CORE_APP_LOCATION`. If a request cannot be resolved, then `/app/index.html` will be returned. This allows the user interface to handle paths which may not resolve to files. - -# User service - -The [user service](pass-core-user-service/README.md) provides information about the logged in user. - -# DOI service - -The [DOI service](pass-core-doi-service/README.md) provides the ability to interact with DOIs. - -# File service - -The [file service](pass-core-file-service/README.md) provides a mechanism to persist files. - -# Metadata Schema service - -The [metadata schema service](pass-core-metadataschema-service/README.md) provides JSON schemas intended to describe PASS submission metadata - -# Metadata Schema service - -The [metadata schema service](pass-core-metadataschema-service/README.md) provides JSON schemas intended to describe PASS submission metadata - -# JSON API - -JSON API is deployed at `/data/`. All of our data model is available, just divided into attributes and relationships. Note that identifiers are now integers, not URIs. -See https://elide.io/pages/guide/v6/10-jsonapi.html for information on how Elide provides support for filtering and sorting. - -See `/swagger/` for auto-generated documentation. - - -## Creating a RepositoryCopy - -``` -curl -v -u backend:moo -X POST "http://localhost:8080/data/repositoryCopy" -H "accept: application/vnd.api+json" -H "Content-Type: application/vnd.api+json" -d @rc1.json -``` - -*rc1.json:* -``` -{ - "data": { - "type": "repositoryCopy", - "attributes": { - "accessUrl": "http://example.com/path", - "copyStatus": "ACCEPTED" - } - } -} -``` - -## Patch a Journal - -Add a publisher object to the publisher relationship in a journal. Note that both the journal and publisher objects must already exist. - -``` -curl -u backend:moo -X PATCH "http://localhost:8080/data/journal/1" -H "accept: application/vnd.api+json" -H "Content-Type: application/vnd.api+json" -d @patch.json -``` - -*patch.json:* - ``` - { - "data": { - "type": "journal", - "id": "1", - "relationships": { - "publisher": { - "data": { - "id": "2", - "type": "publisher" - } - } - } - } -} -``` - -# Messages - -Messages are JSON objects emitted to a JMS broker as text messages. The different types of messages are sent to different queues specified -by the indicatedby the environment variables `PASS_CORE_SUBMISSION_QUEUE`, `PASS_CORE_SUBMISSION_EVENT_QUEUE`, and `PASS_CORE_DEPOSIT_QUEUE`. - -When a Submission is created or modified and the submitted field is true, then a SubmissionReady event is emitted. -The id of the Submission will be set in the `submission` field of the message. - -When a SubmissionEvent is created, then the a SubmissionEvent message will be sent. -The id of the SubmissionEvent will be set in the `submission-event` field of the message. If the `eventType` field is `APPROVAL_REQUESTED_NEWUSER`, -then an `approval-link` field will be set in the field of the message with a link to be sent to a user. - -When a Deposit is created or modified, then a DepositStatus event is emitted. -The id of the Deposit will be set in the `deposit` field of the message. - -Example messages: -``` -{ - "type": "SubmissionReady", - "submission": "1" -} - -{ - "type": "DepositStatus", - "deposit": "1" -} - -{ - "type": "SubmissionEvent", - "submission-event": "1", - "approval-link": "http://example.com/passui?userToken=xxxx" -} -``` - -# Debugging problems - -To get more information, try changing the logging levels set pass-core-main/src/main/resources/logback-spring.xml. -See https://elide.io/pages/guide/v6/12-audit.html for more information. \ No newline at end of file +You can find further documentation and details about [PASS Core](https://docs.eclipse-pass.org/developer-documentation/pass-core) +on the [full documentation site](https://docs.eclipse-pass.org). A full list of all the Eclipse PASS projects can also +be found in the PASS Main repository [README](https://github.com/eclipse-pass/main/blob/main/README.md). \ No newline at end of file diff --git a/pass-core-doi-service/README.md b/pass-core-doi-service/README.md deleted file mode 100644 index 46306e36..00000000 --- a/pass-core-doi-service/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# pass-doi-service - -Service for accepting a DOI and returning a Journal ID and Crossref metadata for the DOI via the /doi/journal endpoint, or -returning information about a manuscript from Unpaywall via the /doi/manuscript endpoint. - -## Description for the `/doi/journal` endpoint - -This service accepts a journal DOI as a query parameter: - -`http://:/doi/journal?doi=` - -DOIs must contain a form like `10.1234/ ...` -If a DOI is of a longer URL form containing the string `doi.org/`, then we truncate the DOI to take everything after -this substring. - -The service validates the form of the doi - if it is valid, then we hit the Crossref API to get information about the -corresponding journal. We then check to see if there is a -`Journal` object in PASS for this journal. If not we create one. The service then returns to the caller a JSON object -containing the `journal-id` of the PASS journal, and a `crossref` object representing the data returned to the service -as a result of the Crossref call. - -### Configuration - -The service will look for an environment variable called PASS_DOI_SERVICE_MAILTO to specify a value on the User-Agent -header on the Crossref request. Default value os `pass@jhu/edu`. - -## Description for the `/doi/manuscript` endpoint - -This service accepts a manuscript DOI as a query parameter: - -`http://:/doi/manuscript?doi=` - -DOIs must contain a form like `10.1234/ ...` -If a DOI is of a longer URL form containing the string `doi.org/`, then we truncate the DOI to take everything after -this substring. - -The service validates the form of the doi - if it is valid, then we hit the Unpaywall API to get information about the -corresponding locations on the web for manuscript PDFs related to the article referenced by the DOI. - -### Configuration - -Just as for the /doi/journal endpoint, this service will look for an environment variable called PASS_DOI_SERVICE_MAILTO -to specify a value for the `email` query parameter on the Unpaywall request. In addition, we may supply values for XREF_BASEURI -and UNPAYWALL_BASEURI, which default to `https://api.crossref.org/v1/works/` and `https://api.unpaywall.org/v2/` respectively. \ No newline at end of file diff --git a/pass-core-file-service/README.md b/pass-core-file-service/README.md deleted file mode 100644 index 8ddcfa53..00000000 --- a/pass-core-file-service/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# pass-core-file-service - -## Description -The pass-core-file-service is a RESTful service that provides the ability to upload, download, and delete files to a -configured persistence store. The service is currently designed to persist to a filesystem or S3 compatible storage. - -## Configuration -The service is configured via environment variables. The service by default will use a filesystem based persistence -store and does not require any additional configuration. If the variable PASS_CORE_FILE_SERVICE_ROOT_DIR does not have -any value, the File Service will default to the system temp folder and create a temporary root folder of a random value -in the system temp. The variable PASS_CORE_FILE_SERVICE_ROOT_DIR is used by both the FILE_SYSTEM and S3 service types. -It is the root directory where temporary files are stored before being persisted to the configured persistence store as -specified by PASS_CORE_FILE_SERVICE_TYPE. If using FILE_SYSTEM as the persistence store, PASS_CORE_FILE_SERVICE_ROOT_DIR -is also the root directory for file persistence. The value for the PASS_CORE_FILE_SERVICE_ROOT_DIR cannot be a S3 bucket, -and it must be a valid path on the local filesystem. - -The following environment variables are available for configuring the service: - -- PASS_CORE_FILE_SERVICE_TYPE=`FILE_SYSTEM` - - Currently supports [`FILE_SYSTEM` | `S3`] -- PASS_CORE_FILE_SERVICE_ROOT_DIR=`/path/to/root/dir` - - The root directory of the service that is used to support file uploads and downloads and the root directory - for file persistence if using FILE_SYSTEM as the persistence store. - - Default example: system_tmp/17318424270250529523 -- PASS_CORE_S3_BUCKET_NAME=`bucket-test-name` - - The name of the S3 bucket to use for file persistence if using S3 as the persistence store. -- PASS_CORE_S3_REPO_PREFIX=`s3-repo-prefix` -- PASS_CORE_S3_ENDPOINT=`http://localhost:9090` - - If using a custom endpoint for S3, this value should be set to the endpoint URL. - -## HTTP Error Responses -The service will return the following HTTP error responses: -- 400 - Bad Request - - This error is returned when a file is empty or missing. It will also handle exceptions that are thrown by the OCFL - library. -- 404 - Not Found - - This is returned when performing a GET/DELETE and the fileId is invalid -- 500 - Internal Server Error - - This error is returned when an unexpected error occurs in the service. - -## Usage Examples - -### Upload a file - -``` -curl -X POST "http://localhost:8080/file" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/file" -``` - -### Download a file - -``` -curl -X GET "http://localhost:8080/file/{uuid}/{origFileName}" -H "accept: application/octet-stream" --output /path/to/file" -``` - -### Delete a file - -``` -curl -X DELETE "http://localhost:8080/file/{fileId}/{origFileName}" -H "accept: application/json" -``` \ No newline at end of file diff --git a/pass-core-metadataschema-service/README.md b/pass-core-metadataschema-service/README.md deleted file mode 100644 index 2a6665f1..00000000 --- a/pass-core-metadataschema-service/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# pass-core-metadataschema-service - -## Description -The pass-core-metadataschema-service is a RESTful service that provides JSON schemas and example data intended to describe PASS submission metadata as per the -[schemas for forms and validation](https://docs.google.com/document/d/1sLWGZR4kCvQVGv-TA5x8ny-AxL3ChBYNeFYW1eACsDw/edit) design, -as well as a [schema service](https://docs.google.com/document/d/1Ki6HUYsEkKPduungp5gHmr7T_YrQUiaTipjorcSnf4s/edit) that will retrieve, -dereference, and place in the correct order all schemas relevant to a given set of pass Repositories. - -## Schemas - -The JSON schemas herein describe the JSON metadata payload of PASS [submission](https://oa-pass.github.io/pass-data-model/documentation/Submission.html) entities. They serve two purposes -1. Validation of submission metadata -2. Generation of forms in the PASS user interface - -These schemas follow a defined structure where properties in `/definitions/form/properties` are intended to be displayed by a UI, e.g. - - { - "title": "Example schema", - "description": "NIHMS-specific metadata requirements", - "$id": "https://github.com/eclipse-pass/metadata-schemas/jhu/example.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "definitions": { - "form": { - "title": "Please provide the following information", - "type": "object", - "properties": { - "journal": { - "$ref": "global.json#/properties/journal" - }, - "ISSN": { - "$ref": "global.json#/properties/ISSN" - } - } - }, - }, - "allOf": [ - { - "$ref": "global.json#" - }, - { - "$ref": "#/definitions/form" - } - ] - } - -A pass [repository](https://oa-pass.github.io/pass-data-model/documentation/Repository.html) entity represents a target repository where -submissions may be submitted. Each repository may link to one or more JSON schemas that define the repository's metadata requirements. -In terms of expressing a desired user interface experience, one may observe a general pattern of pointing to a "common" schema containing ubiquitous fields, -and additionally pointing to a "repository-specific" schema containing any additional fields that are unique to a given repository. - -As a concrete example, the NIHMS repository may point to the [common.json](jhu/common.json) schema, as well as the [nihms.json](jhu/nihms.json) -schema. - -## Schema service - -The schema service is an http service that accepts a list of PASS [repository](https://oa-pass.github.io/pass-data-model/documentation/Repository.html) -entity IDs in a comma separated values String, in a GET request. for example: - -`schemaservice?entityIds=1,2,3` - -For each repository, the schema service will retrieve the list of schemas relevant to the repository, place that list in the correct order (so -that schemas that provide the most dependencies are displayed first), and resolves all `$ref` references that might appear in the schema. - -If a `merge` query parameter is provided (with any value, e.g. `?merge=true`), then all schemas will be merged into a single union schema. -If the service is unable to merge schemas together, it will respond with `409 Conflict` status. -In this case, a client can issue a request without the `merge` query parameter to get the un-merged list of schemas. - -The result is an `application/json` response that contains a JSON list of schemas. - -## HTTP Error Responses -The service will return the following HTTP error responses: -- 400 - Bad Request - - This is returned when the request body is not valid list of comma separated entity Ids -- 409 - Conflict - - This is returned when a schema is unable to be merged or when a schema fetch failed. -- 500 - Internal Server Error - - This error is returned when an unexpected error occurs in the service. - - -## Usage Examples - -### Retrieve schemas for a list of repositories - - `curl --location 'http://localhost:8080/schemaservice?entityIds=1,2,3&merge=true'` \ No newline at end of file diff --git a/pass-core-policy-service/README.md b/pass-core-policy-service/README.md deleted file mode 100644 index 2ef8026f..00000000 --- a/pass-core-policy-service/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# PASS policy service - -Contains the PASS policy service, which provides an HTTP API for determining the policies applicable to a given Submission, as well as the repositories that must be deposited into in order to comply with the applicable policies. - -See the [Documentation for the API](API.md) - -## Configuration -Configuration is achieved via the following environment variables: - -* `PASS_POLICY_INSTITUTION`: This is the institution as it is appears on User.affiliations for every user in the institution: e.g. "johnshopkins.edu" -* `PASS_POLICY_INSTITUTIONAL_POLICY_TITLE`: The value of Policy.title on the institution's Policy object -* `PASS_POLICT_INSTITUTIONAL_REPOSITORY_NAME`: The value of Repository.name on the intstitution's IR Repository object \ No newline at end of file diff --git a/pass-core-user-service/README.md b/pass-core-user-service/README.md deleted file mode 100644 index c28baace..00000000 --- a/pass-core-user-service/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# User service - -The user service provides information about the currently authenticated user. - -The endpoint is `/user/whoami` which will return a JSON object on a GET request. -The JSON object tells the client which PASS object represents the authenticated user. - -Example result: -``` -{ - "id": "1234", - "type": "user", - "uri": "http://localhost:8080/data/user/1234" -} -``` - -The parameter `userToken` can be used to provide a user token. The user token must be associated with -a submission and an email address. (A user token is an encrypted tuple consisting of a PASS resource -URI and a reference URI.) A request with a user token will return as normal, but have -the side effect of setting the submitter of the submission to the current user. In order for -that to happen the submitterEmail address field on the submission must match the email address of the token. - -Then environment variable PASS_CORE_USERTOKEN_KEY provides the key used to encrypt and decrypt user tokens. -If it is not provided or empty, user token support is disabled. To generate a key run the class, -`org.eclipse.pass.usertoken.KeyGenerator`. One way to do that is from `pass-core-usertoken` to do -`mvn compile exec:java -Dexec.mainClass="org.eclipse.pass.usertoken.KeyGenerator"`. From 6ec86894dad450d79074372e92b0e7dff986f073 Mon Sep 17 00:00:00 2001 From: tsande16 Date: Fri, 15 Nov 2024 16:41:54 -0500 Subject: [PATCH 2/5] Delete API.md --- pass-core-policy-service/API.md | 83 --------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 pass-core-policy-service/API.md diff --git a/pass-core-policy-service/API.md b/pass-core-policy-service/API.md deleted file mode 100644 index d5c1acd8..00000000 --- a/pass-core-policy-service/API.md +++ /dev/null @@ -1,83 +0,0 @@ -# Web API - -## Policies - -The policy service has a `/policy/policies` endpoint that determines the set of policies that are applicable to -a given submission. Note: The results may be dependent on _who_ submits the request. For example, if -somebody from JHU invokes the policies endpoint, a general "policy for JHU employees" may be included in the results. - -### Policies Request - -`GET /policy-service/policies?submission=${SUBMISSION_ID}` - -### Policies Response - -The response is a list of IDs to Policy resources, decorated with a `type` property: - -```json -[ - { - "id": "3", - "type": "funder" - }, - { - "id": "22", - "type": "institution" - } -] -``` - - -## Repositories - -The policy service has a `/policy/repositories` endpoint that, for a given submission, calculates the repositories that may be -deposited into in order to satisfy any applicable policies for that submission. - -### Repositories Request - -GET `/policy-service/repositories?submission=${SUBMISSION_ID}` -or, with urlencoded (with encoded submission=${SUBMISSION_ID}) as the body: - -### Repositories Response - -The response is an application/json document that lists repositories sorted into buckets as follows: - -```json -{ - "required": [ - { - "url": "1", - "selected": false - }, - { - "url": "2", - "selected": false - }, - { - "url": "3", - "selected": false - }, - { - "url": "4", - "selected": false - }, - { - "url": "5", - "selected": false - } - ], - "optional": [ - { - "url": "6", - "selected": true - } - ] -} -``` - - -Repositories contained in the above list are JSON objects containing the following fields: - -* `url`: the URL to the repository resource in Fedora -* `selected`: optional field. Specifies if the repository should be selected by default in the UI or not. - From 7736d43ce4a5c8d4f58f3cd60713ee85e4be71d8 Mon Sep 17 00:00:00 2001 From: tsande16 Date: Tue, 19 Nov 2024 15:15:22 -0500 Subject: [PATCH 3/5] Add Guides and License sections --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5d848cdb..2bfacd33 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,13 @@ Elide JSON:API based interface to handle essential entities, including submissio Both the UI and backend services interact with the data model using JSON:API. PASS core is responsible for access control and authorization, event handling and notifications. -You can find further documentation and details about [PASS Core](https://docs.eclipse-pass.org/developer-documentation/pass-core) -on the [full documentation site](https://docs.eclipse-pass.org). A full list of all the Eclipse PASS projects can also -be found in the PASS Main repository [README](https://github.com/eclipse-pass/main/blob/main/README.md). \ No newline at end of file +A full list of all the Eclipse PASS projects can be found in the PASS Main repository [README](https://github.com/eclipse-pass/main). + +# Guides + +* [PASS Core Documentation](https://docs.eclipse-pass.org/developer-documentation/pass-core) +* [PASS Documentation](https://docs.eclipse-pass.org/) + +# License + +PASS Core is Open Source software released under the [Apache 2.0 license](LICENSE). \ No newline at end of file From c11eeb9235f2a0fc8397f124d3624b722446ca7c Mon Sep 17 00:00:00 2001 From: tsande16 Date: Tue, 19 Nov 2024 15:47:36 -0500 Subject: [PATCH 4/5] Add workflow status badge --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bfacd33..52c69e30 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,6 @@ A full list of all the Eclipse PASS projects can be found in the PASS Main repos # License -PASS Core is Open Source software released under the [Apache 2.0 license](LICENSE). \ No newline at end of file +PASS Core is Open Source software released under the [Apache 2.0 license](LICENSE). + +![Pass Core](https://github.com/eclipse-pass/pass-core/actions/workflows/snapshot.yml/badge.svg) \ No newline at end of file From 1004e27b6c61ccf78fbf972b51092ea5c4dba24f Mon Sep 17 00:00:00 2001 From: tsande16 Date: Tue, 19 Nov 2024 15:54:08 -0500 Subject: [PATCH 5/5] Update status badge to be in the main header --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 52c69e30..a323cb1c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PASS Core +# PASS Core ![Pass Core](https://github.com/eclipse-pass/pass-core/actions/workflows/snapshot.yml/badge.svg) PASS Core is the central backend service within the PASS application that manages the core data model. It provides an Elide JSON:API based interface to handle essential entities, including submissions, users, repositories, and policies. @@ -16,4 +16,3 @@ A full list of all the Eclipse PASS projects can be found in the PASS Main repos PASS Core is Open Source software released under the [Apache 2.0 license](LICENSE). -![Pass Core](https://github.com/eclipse-pass/pass-core/actions/workflows/snapshot.yml/badge.svg) \ No newline at end of file