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

Add search exposed config endpoint #240

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
41 changes: 38 additions & 3 deletions configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
## Main Endpoint
**/api/config/properties**

As we don't have yet an use case to iterate over all the configuration properties the main endpoint is not implemented and a 405 error code is returned according to our [general error response codes](README.md#Error codes).
As we don't have yet an use case to iterate over all the configuration properties the main endpoint is not implemented and a 405 error code is returned according to our [general error response codes](README.md#Error-Codes).

## Single property
**/api/config/properties/<:property>**

This endpoint provides functionality to retrieve certain (configurable) configuration properties.
The DSpace server will have a whitelist of properties that can be retrieved by this endpoint.

For example:

```json
{
Expand All @@ -21,5 +22,39 @@ The DSpace server will have a whitelist of properties that can be retrieved by t
}
```

* 200 OK - if the operation succeed
* 404 Not found - if the property doesn't exist or isn't configured to be retrieved
* 200 OK - if the operation succeeded
* 404 Not found - if the property doesn't exist or isn't configured to be exposed

## Search methods
**/api/config/properties/search/isExposed**
Copy link
Member

Choose a reason for hiding this comment

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

I'm not completely sure about the path isExposed but I'm not against it. Just adding this comment to share my thought. It was looking strange to me at a first look but I haven't found any direction in our naming convention https://github.com/DSpace/RestContract?tab=readme-ov-file#on-the-naming-of-endpoints

I found that we have a lot of diversity in the way that search methods have been named so far

  • some start with findBy...
  • other start with byXXX
  • allmost all seems to use the CamelCase convention (that we decide to avoid for the resource collection endpoints)


The supported parameters are:
* page, size [see pagination](README.md#Pagination)

This endpoint returns all exposed configuration variables.

For example:

```json
[{
Copy link
Member

Choose a reason for hiding this comment

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

we need to follow the usual HAL format for resource collections having an embedded with the pagination information

"name": "google.analytics.key",
"values": [
"UA-XXXXXX-X"
]
},
{
"name": "websvc.opensearch.autolink",
"values": [
true
]
},
{
"name": "orcid.authorize-url",
"values": [
"https://sandbox.orcid.org/oauth/authorize"
]
}]
```

* 200 OK - if the operation succeeded
* 404 Not found - if no property is configured to be exposed
Copy link
Member

Choose a reason for hiding this comment

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

this should be an empty list but still 200.
The endpoint must support pagination parameters according to our general rules https://github.com/DSpace/RestContract?tab=readme-ov-file#pagination