Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4ba461a
Move DOI creation from PostAction to new PutAction
jburke-cadc Oct 6, 2025
7099d0d
added property to enable reviewer workflow
jburke-cadc Oct 7, 2025
11880a2
remove mint and status/public endpoints from OpenAPI doc
jburke-cadc Oct 27, 2025
e7895b6
add 'in review' to Status enum
jburke-cadc Oct 27, 2025
8e40f05
cleanup some formatting
jburke-cadc Oct 27, 2025
b09ef99
CADC-14486 remove unneeded classes
jburke-cadc Dec 9, 2025
129cfa5
CADC-14486 move common variables to separate class
jburke-cadc Dec 9, 2025
6360224
CADC-14486 remove use of put action
jburke-cadc Dec 9, 2025
d7b9f72
CADC-14486 handle a json multi-part with node properties
jburke-cadc Dec 9, 2025
3626f58
CADC-14486 update build dependencies
jburke-cadc Dec 9, 2025
c37622c
CADC-14486 restore mint endpoint
jburke-cadc Dec 9, 2025
bfb8261
CADC-14486 update README
jburke-cadc Dec 9, 2025
a7afa47
CADC-14486 update for posted JSON of node properties
jburke-cadc Dec 9, 2025
6ac16f4
CADC-14486 updated integration tests
jburke-cadc Dec 9, 2025
3f01546
CADC-14486 update multi-part for a post to a doi
jburke-cadc Dec 9, 2025
d0cb1bd
cadc-14486 update permissions for status updates
jburke-cadc Dec 19, 2025
4db9650
CADC-14486 updated integration tests
jburke-cadc Dec 19, 2025
6cf671f
CADC-14486 Added a few things to support the frontend
zss1980 Dec 23, 2025
44d8201
CADC-14486 Added a few things to support the frontend
zss1980 Dec 23, 2025
44cfb8e
Merge branch 'CADC-14486' into CADC-14486-front
jburke-cadc Jan 5, 2026
8d64941
CADC-14486 Cleaned up
zss1980 Jan 20, 2026
abc7adb
Fixied build
zss1980 Jan 22, 2026
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
18 changes: 5 additions & 13 deletions doi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ The doi.properties configures the DataCite service used to register new DOIs.
# VOSpace uri to the parent DOI folder.
ca.nrc.cadc.doi.vospaceParentUri = {parent folder URI}

# DOI Identifier Prefix
ca.nrc.cadc.doi.doiIdentifierPrefix = {DOI Identifier Prefix}

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

Expand All @@ -47,13 +50,11 @@ ca.nrc.cadc.doi.datacite.password = {password}

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

# (Optional) DOI Identifier Prefix
ca.nrc.cadc.doi.doiIdentifierPrefix = {DOI Identifier Prefix}
```

_parentUri_ is the URI to the DOI parent folder in the VOSpace service.

_doiIdentifierPrefix_ is prefix to the DOI Identifier.

_metaDataPrefix_ is the prefix prepended to the DOI name used to create the file 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.
Expand All @@ -68,23 +69,14 @@ _password_ is the DataCite account password.

_accountPrefix_ is the registered prefix for a DataCite account.

_doiIdentifierPrefix_ is prefix to the DOI Identifier.

**For Alternative DOI Settings ONLY**
```
# Publisher Group URI
ca.nrc.cadc.doi.publisherGroupURI = {Publisher Group URI}

# self Publish
ca.nrc.cadc.doi.selfPublish = {true|false}
```

_publisherGroupURI_ is the URI to the group which gives permission to Approve/Publish or Reject DOIs to the user associated with this group.

_selfPublish_ is to give permission to Mint DOIs. If set to true, only DOI Owner can Mint his DOI. If set to false, only a user from publisher group can Mint all the DOIs.

#### Note: If `publisherGroupURI` is configured, `selfPublish` has to be configured 'false'.

**For developer testing only:**
```
# (optional) Create a random DOI ID for testing
Expand Down
2 changes: 2 additions & 0 deletions doi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ dependencies {
implementation 'org.opencadc:cadc-util:[1.11.2,)'
implementation 'org.opencadc:cadc-log:[1.1.0,)'
implementation 'org.opencadc:cadc-rest:[1.3.20,)'
implementation 'org.opencadc:cadc-access-control:[1.0,2.0)'
implementation 'org.opencadc:cadc-access-control-identity:[1.1.0,)'
implementation 'org.opencadc:cadc-vosi:[1.4.3,2.0)'
implementation 'org.opencadc:cadc-vos:[2.0.7,3.0)'
implementation 'org.opencadc:cadc-vos-client:[2.0.4,3.0)'
implementation "org.json:json:20240303"

runtimeOnly 'org.opencadc:cadc-registry:[1.8.0,)'

Expand Down
43 changes: 35 additions & 8 deletions doi/src/intTest/java/ca/nrc/cadc/doi/AltPermissionsTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package ca.nrc.cadc.doi;

import ca.nrc.cadc.doi.datacite.Date;
import ca.nrc.cadc.doi.datacite.DateType;
import ca.nrc.cadc.doi.datacite.Resource;
import ca.nrc.cadc.doi.io.DoiParsingException;
import ca.nrc.cadc.doi.io.DoiXmlReader;
Expand All @@ -13,12 +15,17 @@
import ca.nrc.cadc.util.Log4jInit;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.opencadc.vospace.ContainerNode;

Expand All @@ -44,14 +51,27 @@ public class AltPermissionsTest extends LifecycleTest {
Log4jInit.setLevel("ca.nrc.cadc.doi", Level.INFO);
}

@Override
@Ignore
@Test
public void testLifecycle() throws Exception {
// skip re-running the lifecycle test
}

/*
* Test Case 1:
* cadc user:
* create a DOI - success
* Update it - success
* Mint it - fail with 403 status
* Mint it - fail with 403
* - set status 'in review' - success
* - search DOIStatus with 'status = in review' filter - success
* - Mint it - fail with 403
* - delete it - fail with 403
* - set status 'in progress'
* get all DOI Statuses - should find the recently created DOI
* search DOIStatus with 'status = draft' filter - success
* - delete it - success
* Publisher user:
* get DOI - success
* get all DOI Statuses - should find the recently created DOI
Expand All @@ -72,7 +92,7 @@ public void testDOILifecycleWithAlternateSettings() throws Exception {
log.debug("Test DOI lifecycle with Alternate Settings");

// Create a new DOI
Resource expected = getTestResource(true, true, true);
Resource expected = getTestResource(true, true);

String doiSuffix = Subject.doAs(readWriteSubject, (PrivilegedExceptionAction<String>) () -> {

Expand Down Expand Up @@ -190,12 +210,15 @@ public void testDOILifecycleWithAlternateSettings() throws Exception {
* Test Case 2:
* cadc user:
* create a DOI - success
* set status = 'in review'
* delete it - 403
* set status = 'in progress'
* delete it - success
* */
@Test // creator of DOI can delete it
public void testDeleteDOIByDOIOwner() throws Exception {
// Create a new DOI
Resource expected = getTestResource(true, true, true);
Resource expected = getTestResource(true, true);

String doiId = Subject.doAs(readWriteSubject, (PrivilegedExceptionAction<String>) () -> {

Expand All @@ -216,12 +239,16 @@ public void testDeleteDOIByDOIOwner() throws Exception {
* cadc user:
* create a DOI - success
* publisher user:
* delete it - success
* delete it - 403
* cadc user:
* set status = 'in review'
* publisher user:
* delete it - 403
* */
@Test // publisher can delete a DOI
@Test // publisher can delete their own DOI
public void testDeleteDOIByPublisher() throws Exception {
// Create a new DOI
Resource expected = getTestResource(true, true, true);
Resource expected = getTestResource(true, true);

String doiId = Subject.doAs(readWriteSubject, (PrivilegedExceptionAction<String>) () -> {
// create a new DOI
Expand Down Expand Up @@ -255,7 +282,7 @@ public void testDeleteDOIByPublisher() throws Exception {
* */
@Test // If publisher is the owner of a DOI, he can not mint it.
public void testPublisherAsDOIOwnerForMintAction() throws PrivilegedActionException {
Resource expected = getTestResource(true, true, true);
Resource expected = getTestResource(true, true);
String doiId = Subject.doAs(publisherSubject, (PrivilegedExceptionAction<String>) () -> {
Resource actual = create(expected, DOISettingsType.ALT_DOI);
String doiID = getDOISuffix(actual.getIdentifier().getValue());
Expand Down Expand Up @@ -309,7 +336,7 @@ public void testPublisherAsDOIOwnerForMintAction() throws PrivilegedActionExcept

@Test
public void testDOISearchEndpoint() throws PrivilegedActionException, DoiParsingException, IOException {
Resource expected = getTestResource(true, true, true);
Resource expected = getTestResource(true, true);

String mintedDOIId = Subject.doAs(readWriteSubject, (PrivilegedExceptionAction<String>) () -> {

Expand Down
Loading