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

CADC-8776 update doi service int-test #9

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
49 changes: 22 additions & 27 deletions doi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,60 +24,55 @@ See <a href="https://github.com/opencadc/reg/tree/master/cadc-registry">cadc-reg
The doi.properties configures the DataCite service used to register new DOI's.

```
# Vault Service resourceID
ca.nrc.cadc.doi.vaultResourceID = {vault service resourceID}

# Group Management Service (GMS) resourceID
ca.nrc.cadc.doi.gmsResourceID = {GMS service resourceID}

# Path in vault to the parent folder containing the DOI's.
ca.nrc.cadc.doi.parentPath = {DOI parent folder path}
# VOSpace uri to the parent DOI folder.
ca.nrc.cadc.doi.vospaceParentUri = {parent folder URI}

# Prefix to the DOI metadata file
ca.nrc.cadc.doi.metadataFilePrefix = {file prefix}
ca.nrc.cadc.doi.metaDataPrefix = {metadata file prefix}

# Prefix to the DOI GMS Group name
ca.nrc.cadc.doi.groupPrefix = {group prefix}

# DOI landing page url
ca.nrc.cadc.doi.landingUrl = {landing page url}

# DataCite MDS REST endpoint
ca.nrc.cadc.doi.datacite.mdsUrl = {MDS url}

# DataCite account prefix
ca.nrc.cadc.doi.datacite.accountPrefix = {account prefix}

# DataCite account username
ca.nrc.cadc.doi.datacite.username = {username}

# DataCite account password
ca.nrc.cadc.doi.datacite.password = {password}
```

_vaultResourceID_ the resourceID to the vault service used to store the DOI metadata and files.
# DataCite account prefix
ca.nrc.cadc.doi.datacite.accountPrefix = {account prefix}
```

_gmsResourceID_ the resourceID to the GMS service used for authentication and authorization.
_parentUri_ is the URI to the DOI parent folder in the VOSpace service.

_parentPath_ is the path in the vault service to the DOI parent folder.
_metaDataPrefix_ is the prefix prepended to the DOI name used to create the file for the DOI specific metadata stored in VOSpace.

_metadataFilePrefix_ is the prefix prepended to the DOI name to create the filename for the DOI specific metadata stored in VOSpace.
_groupPrefix_ is the prefix prepended to the DOI name to create the group name for the DOI.

_landingUrl_ is the base URL used to compose URLs to individual DOI's.

_mdsUrl_ is the URL to the Datacite MDS rest endpoint used to create and update DOI's.

_accountPrefix_ is the registered prefix for the DataCite account.
_mdsUrl_ is the URL to the DataCite MDS rest endpoint used to create and update DOI's.

_username_ is the DataCite account username.

_password_ is the DataCite account password.

_accountPrefix_ is the registered prefix for a DataCite account.

**For developer testing only:**
```
# (optional) Create a random DOI name for testing
ca.nrc.cadc.doi.test.randomName = {true|false}

# (optional) Group URI for a group that has read/write permissions to test DOI's
ca.nrc.cadc.doi.test.groupUri = {group URI}
# (optional) Create a random DOI ID for testing
ca.nrc.cadc.doi.randomTestID = {true|false}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really necessary? Can just the prefix and different test directory be enough? Under what circumstances would int testing interfere with production and what would be the consequences?
If you can get rid of this then you can remove traces of test code in the service code as well.

```

_randomID_ is a flag to create a random DOI ID for testing purposes, to avoid conflicts with existing DOI's in vospace or DOI groups in GMS.

### required certificates
The following certificates are required to run the service, and are expected to be in the `/config` directory.

Expand Down Expand Up @@ -113,10 +108,10 @@ Usage of this service can be divided into three distinct phases described below.
### DOI creation
1. user enters metadata of a publication using a GUI
- title
- first auther
- first author
- additional authors
- journal reference
2. user submits the metdata
2. user submits the metadata
3. this service then:
- validates the metadata
- assigns a DOI for the metadata
Expand Down
7 changes: 7 additions & 0 deletions doi/intTest.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# intTest.properties expects the following entries:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this file be in src/intTest directory instead?

# The resourceID of the doi service
doiResourceID = ivo://opencadc.org/doi

# The VOSURI of the DOI parent folder in the VOSpace service.
vospaceParentUri = vos://opencadc.org~vospace/<DOI parent path>
21 changes: 8 additions & 13 deletions doi/src/intTest/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# doi service integration tests

The integration tests run against a local doi instance defined by the `ivo://opencadc.org/doi` resourceID,
and a vault service defined by the `ivo://opencadc.org/vault` resourceID'.
The integration tests can run against a local `doi` service, and either a local or remove VOSpace service.

The integration tests expect the following entries in `intTest.properties` in the root of the doi module.
`doiResoruceID` is the resourceID of the doi service.
`vospaceParentUri` is the VOSURI of the DOI parent folder in the VOSpace service.

Client test certificates in the `$A/test-certificates/` directory are used to authenticate to the doi service.
The following certificates are expected.
- `doiadmin.pem` owns and has full access to a test DOI.
- `doi-auth.pem` has read-write access to a test DOI.
- `doi-noauth.pem` has read-only access to a test DOI.

The integration tests expect the following entries in `doi.properties`.

`ca.nrc.cadc.doi.test.randomName = true` to create random DOI names for testing.

`ca.nrc.cadc.doi.test.groupUri = {group URI}` to specify the group URI that will have read/write permissions to a test DOI.
The `doi-auth.pem` user is a member of this group, giving this user read/write access to a test DOI.
The `doi-noauth.pem` user is not a member of this group, giving this user read-only access to a test DOI.
- `doi-admin.pem` owns and has full permissions to a test DOI.
- `doi-auth.pem` has read-write permissions to a test DOI.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How? A group is required for that I assume.

- `doi-noauth.pem` has read-only permissions to a test DOI.
221 changes: 0 additions & 221 deletions doi/src/intTest/java/ca/nrc/cadc/doi/CreateTest.java

This file was deleted.

Loading