Skip to content

Commit

Permalink
style: trim trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
apetro committed Feb 23, 2018
1 parent a1e70b0 commit d1cafc3
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

This messaging microservice is intended for use with [uportal-home](https://github.com/uPortal-Project/uportal-home).

uPortal messages include both notifications and announcements, and can be tailored for audiences as small as one person.
uPortal messages include both notifications and announcements, and can be tailored for audiences as small as one person.

## What is a message?

A message is an announcement or notification which can be targeted to an entire user population, a subset of the population, or a single user.
A message is an announcement or notification which can be targeted to an entire user population, a subset of the population, or a single user.

This microservice processes messages in json form. The details of how that json is structured are found in the uportal-app-framework project's [documentation](https://github.com/uPortal-Project/uportal-app-framework/blob/master/docs/messaging-implementation.md).
This microservice processes messages in json form. The details of how that json is structured are found in the uportal-app-framework project's [documentation](https://github.com/uPortal-Project/uportal-app-framework/blob/master/docs/messaging-implementation.md).

## Configuration

Set the source of your messages in the ``application.properties`` file. In this example, we've selected a json file in our resources directory.
Set the source of your messages in the ``application.properties`` file. In this example, we've selected a json file in our resources directory.
``` javascript
message.source=classpath:messages.json
```

## To Build

This project uses maven. ```$ mvn package ``` will build a warfile for deployment.
This project uses maven. ```$ mvn package ``` will build a warfile for deployment.

To run locally, ```$ mvn spring-boot:run ``` will compile and run this microservice.
To run locally, ```$ mvn spring-boot:run ``` will compile and run this microservice.

## Endpoints

Expand All @@ -30,32 +30,32 @@ To run locally, ```$ mvn spring-boot:run ``` will compile and run this microserv
### `/`

calls:
```java
```java
@RequestMapping("/")
public @ResponseBody
void index(HttpServletResponse response)
void index(HttpServletResponse response)
```
returns:

```
{"status":"up"}
```
description:
This endpoint returns a small json object indicating that the status of the application is healthy.
This endpoint returns a small json object indicating that the status of the application is healthy.

### `/messages`

calls:
``` java
@RequestMapping(value="/messages", method=RequestMethod.GET)
public @ResponseBody void messages(HttpServletRequest request,
HttpServletResponse response)
HttpServletResponse response)
```
returns:
A JSON object containing messages filtered to the viewing user and the current context.

description:
Intended as the primary endpoint for servicing typical users. The idea is to move all the complication of message
Intended as the primary endpoint for servicing typical users. The idea is to move all the complication of message
resolution server-side into this microservice so that a typical client can request this data and uncritically render it.

Currently filters to:
Expand All @@ -66,18 +66,18 @@ specified in ISO format, as in `2018-02-14` or `2018-02-14:09:46:00`), AND

Expectations:

+ `isMemberOf` header conveying semicolon-delimited group memberships. (This practice is typical in UW-Madison
Shibboleth SP implementation.) Fails gracefully yet safely: if this header is not present, considers the user a member
+ `isMemberOf` header conveying semicolon-delimited group memberships. (This practice is typical in UW-Madison
Shibboleth SP implementation.) Fails gracefully yet safely: if this header is not present, considers the user a member
of no groups.

Versioning:
The details of the filtering are NOT a semantically versioned aspect of the API. That is to say, what is versioned
here is that `/messages` returns the messages appropriate for the requesting user. Increasing sophistication in what
here is that `/messages` returns the messages appropriate for the requesting user. Increasing sophistication in what
"appropriate" means is not a breaking change.

Security:
WARNING: Does not apply any access control other than filtering to messages applicable to the user's groups. If
additional access control is needed (it may not be needed), implement it at the container layer.
WARNING: Does not apply any access control other than filtering to messages applicable to the user's groups. If
additional access control is needed (it may not be needed), implement it at the container layer.

### `/admin/allMessages`
calls:
Expand All @@ -89,7 +89,7 @@ calls:
```

returns:
A JSON object, containing every known message, regardless of all criteria.
A JSON object, containing every known message, regardless of all criteria.

description:
Intended as an administrative or troubleshooting view on the data.
Expand All @@ -109,7 +109,6 @@ description:
Intended as an administrative or troubleshooting view on the data for a specific message.

Security:
WARNING: Does not apply any access control. Implement access control at the container layer.
Whatever access control is appropriate, apply it to the `/admin/message` path at e.g. the `httpd`
WARNING: Does not apply any access control. Implement access control at the container layer.
Whatever access control is appropriate, apply it to the `/admin/message` path at e.g. the `httpd`
layer. The `/admin` prefix is intended to facilitate this.

0 comments on commit d1cafc3

Please sign in to comment.