Skip to content

Commit 353795b

Browse files
committed
Merge branch 'release/20.0.0'
2 parents 92f8fb7 + 466fa06 commit 353795b

97 files changed

Lines changed: 5888 additions & 282 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/FUNDING.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ log/
1515
bin/
1616
*.war
1717
*.iml
18+
*.ipr
19+
*.iws
1820
*.log
1921
tmp/
2022
./apache-tomcat
21-
apache-tomcat.zip
23+
apache-tomcat.zip

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Changelog
2+
3+
We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.
4+
5+
20.0.0 (09-02-2020)
6+
===================
7+
8+
OSF CAS first release with basic authentication features for OSF
9+
10+
* Username and password login
11+
* Username and verification key login
12+
* Two-factor authenticaion
13+
* Long-term authentication
14+
* ORCiD login
15+
16+
Technical details
17+
18+
* JSON service registry
19+
* JPA ticket regisrtry with PostgreSQL
20+
* JPA PostgreSQL authentication backend
21+
* Customized login web flow and authentication including:
22+
* OSF credential and metadata populator
23+
* OSF non-interactive authentication action
24+
* OSF PostgreSQL authentication handler
25+
* Pac4j authentication delegation
26+
* Two-factor authentication using time-based one-time password
27+
* Customized authentication exception handling
28+
* Customized user interface
29+

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN mkdir -p ~/.gradle \
1313
&& ./gradlew --version;
1414

1515
RUN cd cas-overlay \
16-
&& ./gradlew clean build --parallel;
16+
&& ./gradlew clean build --parallel --no-daemon;
1717

1818
FROM adoptopenjdk/openjdk11:alpine-jre AS cas
1919

PULL_REQUEST_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!--
2+
Before submitting the PR, double check the target branch.
3+
- For critical hotfixes, select "master" as the target branch.
4+
(Re)name your branch to "hotfix/<branch_name>".
5+
- For the rest, select "develop" as the target branch.(Re)name
6+
your branch with a proper prefix as listed below.
7+
- "feature/" for features and improvements
8+
- "fix/" for bug fixes
9+
- For security fixes, please check with your team lead before
10+
submitting your Pull Request.
11+
-->
12+
13+
## Ticket
14+
15+
[ENG-****](https://openscience.atlassian.net/browse/ENG-****)
16+
17+
## Purpose
18+
19+
<!-- Describe the purpose of your changes. -->
20+
21+
## Changes
22+
23+
<!-- Briefly describe or list your changes. -->
24+
25+
## Dev Notes
26+
27+
<!-- Any special note for reviewer and / or other developers? -->
28+
29+
## QA Notes
30+
31+
<!-- Any special note for QA testing? -->
32+
33+
## Dev-Ops Notes
34+
35+
<!-- Any special note for PR merge and / or server deployment? -->

README.md

Lines changed: 52 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,90 @@
1-
CAS Overlay Template [![Build Status](https://travis-ci.org/apereo/cas-overlay-template.svg?branch=master)](https://travis-ci.org/apereo/cas-overlay-template)
2-
=======================
1+
OSF CAS by Center for Open Science
2+
==================================
33

4-
Generic CAS WAR overlay to exercise the latest versions of CAS. This overlay could be freely used as a starting template for local CAS war overlays.
4+
`Master` Build Status: **TBI**
55

6-
# Versions
7-
8-
- CAS `6.1.x`
9-
- JDK `11`
10-
11-
# Overview
12-
13-
To build the project, use:
14-
15-
```bash
16-
# Use --refresh-dependencies to force-update SNAPSHOT versions
17-
./gradlew[.bat] clean build
18-
```
6+
`Develop` Build Status: **TBI**
197

20-
To see what commands are available to the build script, run:
8+
Versioning Scheme: [![CalVer Scheme](https://img.shields.io/badge/calver-YY.MINOR.MICRO-22bfda.svg)](http://calver.org)
219

22-
```bash
23-
./gradlew[.bat] tasks
24-
```
25-
26-
To launch into the CAS command-line shell:
27-
28-
```bash
29-
./gradlew[.bat] downloadShell runShell
30-
```
31-
32-
To fetch and overlay a CAS resource or view, use:
33-
34-
```bash
35-
./gradlew[.bat] getResource -PresourceName=[resource-name]
36-
```
37-
38-
To list all available CAS views and templates:
39-
40-
```bash
41-
./gradlew[.bat] listTemplateViews
42-
```
43-
44-
To unzip and explode the CAS web application file and the internal resources jar:
45-
46-
```bash
47-
./gradlew[.bat] explodeWar
48-
```
10+
License: [![License](https://img.shields.io/hexpm/l/plug.svg)](https://github.com/apereo/cas/blob/master/LICENSE)
4911

50-
# Configuration
12+
# About
5113

52-
- The `etc` directory contains the configuration files and directories that need to be copied to `/etc/cas/config`.
14+
OSF CAS is the centralized authentication and authorization service for the [OSF](https://osf.io/) and its services such as [OSF Preprints](https://osf.io/preprints/) and [OSF Registries](https://osf.io/registries).
5315

54-
```bash
55-
./gradlew[.bat] copyCasConfiguration
56-
```
16+
# Features
5717

58-
- The specifics of the build are controlled using the `gradle.properties` file.
18+
* OSF username and password login
19+
* OSF username and verification key login
20+
* OSF two-factor authentication
21+
* **WIP** - Delegated authentication
22+
* **TBI** - OAuth authorization server for OSF
23+
* **TBI** - SAML service provider
5924

60-
## Adding Modules
25+
# Implementations
6126

62-
CAS modules may be specified under the `dependencies` block of the [Gradle build script](build.gradle):
27+
The implementation of OSF CAS is based on [Apereo CAS 6.2.x](https://github.com/apereo/cas/tree/6.2.x) via [CAS Overlay Template 6.2.x](https://github.com/apereo/cas-overlay-template/tree/6.2). Refer to [CAS Documentaion 6.2.x](https://apereo.github.io/cas/6.2.x/) for more details.
6328

64-
```gradle
65-
dependencies {
66-
compile "org.apereo.cas:cas-server-some-module:${project.casVersion}"
67-
...
68-
}
69-
```
29+
## Legacy Implementations
7030

71-
To collect the list of all project modules and dependencies:
31+
A legacy version can be found at [CAS Overlay](https://github.com/CenterForOpenScience/cas-overlay), which was built on [Jasig CAS 4.1.x](https://github.com/apereo/cas/tree/4.1.x) via [CAS Overlay Template 4.1.x](https://github.com/apereo/cas-overlay-template/tree/4.1).
7232

73-
```bash
74-
./gradlew[.bat] allDependencies
75-
```
33+
# Versions
7634

77-
### Clear Gradle Cache
35+
- OSF CAS `20.0.x`
36+
- Apereo CAS `6.2.x`
37+
- PostgreSQL `9.6`
38+
- JDK `11`
7839

79-
If you need to, on Linux/Unix systems, you can delete all the existing artifacts (artifacts and metadata) Gradle has downloaded using:
40+
# Build and Run OSF CAS
8041

81-
```bash
82-
# Only do this when absolutely necessary
83-
rm -rf $HOME/.gradle/caches/
84-
```
42+
## OSF
8543

86-
Same strategy applies to Windows too, provided you switch `$HOME` to its equivalent in the above command.
44+
OSF CAS requires a working OSF running locally. Refer to OSF's [README-docker-compose.md](https://github.com/CenterForOpenScience/osf.io/blob/develop/README-docker-compose.md) for how to set up and run OSF with `docker-compose`. Must disable `fakeCAS` to free port `8080`.
8745

88-
# Deployment
46+
In `cas.propeties`, global JDBC settings can be found [here](https://github.com/cslzchen/osf-cas/blob/21bb277cc38b3364fd67a632c0bc7b7a6ffc9efd/etc/cas/config/cas.properties#L69-L73) and JPA specific settings can be found [here](https://github.com/cslzchen/osf-cas/blob/21bb277cc38b3364fd67a632c0bc7b7a6ffc9efd/etc/cas/config/cas.properties#L54-L60).
8947

90-
- Create a keystore file `thekeystore` under `/etc/cas`. Use the password `changeit` for both the keystore and the key/certificate entries. This can either be done using the JDK's `keytool` utility or via the following command:
48+
## CAS DB
9149

92-
```bash
93-
./gradlew[.bat] createKeystore
94-
```
50+
OSF CAS is configured to use the [JPA Ticket Registry](https://apereo.github.io/cas/6.2.x/ticketing/Configuring-Ticketing-Components.html#ticket-registry) for durable ticket storage. Thus, a relational database is required. Set up a `PostgreSQL@9.6` server and update *JPA Ticket Registry* [settings](https://github.com/cslzchen/osf-cas/blob/21bb277cc38b3364fd67a632c0bc7b7a6ffc9efd/etc/cas/config/cas.properties#L65-L113) in `cas.propeties` accordingly. Must use a port other than the already occupied `5432`.
9551

96-
- Ensure the keystore is loaded up with keys and certificates of the server.
52+
## Signing and Encryption Keys
9753

98-
On a successful deployment via the following methods, CAS will be available at:
54+
Refer to [settings](https://github.com/cslzchen/osf-cas/blob/21bb277cc38b3364fd67a632c0bc7b7a6ffc9efd/etc/cas/config/cas.properties#L117-L133) in `cas.properties` for signing and encrypting client session and ticket granting cookie.
9955

100-
* `https://cas.server.name:8443/cas`
56+
## Authentication Delegation
10157

102-
## Executable WAR
58+
### ORCiD Login
10359

104-
Run the CAS web application as an executable WAR:
60+
Set up a developer app at [ORCiD](https://orcid.org/developer-tools) with `http://localhost:8080/login` and `http://192.168.168.167:8080/login` as *redirect URIs*. Update
61+
`cas.authn.pac4j.orcid.id` and `cas.authn.pac4j.orcid.secret` in `cas.properties` [settings](https://github.com/cslzchen/osf-cas/blob/21bb277cc38b3364fd67a632c0bc7b7a6ffc9efd/etc/cas/config/cas.properties#L186-L192).
10562

106-
```bash
107-
./gradlew[.bat] run
108-
```
63+
### `fakeCAS` Login
10964

110-
Debug the CAS web application as an executable WAR:
65+
With OSF CAS running locally as the authentication server for OSF, `fakeCAS` can be configured to serve as an identity provider. Simply update `fakecas` in OSF's [docker-compose.yaml](https://github.com/CenterForOpenScience/osf.io/blob/dc87c86b2afb7ad4e801b23c6428e3d2169e3e36/docker-compose.yml#L235-L247) to listen on port 8081.
11166

112-
```bash
113-
./gradlew[.bat] debug
11467
```
115-
116-
Run the CAS web application as a *standalone* executable WAR:
117-
118-
```bash
119-
./gradlew[.bat] clean executable
68+
fakecas:
69+
image: quay.io/centerforopenscience/fakecas:master
70+
command: fakecas -host=0.0.0.0:8081 -osfhost=localhost:5000 -dbaddress=postgres://postgres@postgres:5432/osf?sslmode=disable
71+
restart: unless-stopped
72+
ports:
73+
- 8081:8081
74+
depends_on:
75+
- postgres
76+
stdin_open: true
12077
```
12178

122-
## External
123-
124-
Deploy the binary web application file `cas.war` after a successful build to a servlet container of choice.
125-
126-
## Docker
127-
128-
The following strategies outline how to build and deploy CAS Docker images.
79+
Related settings in `cas.propeties` can be found [here](https://github.com/cslzchen/osf-cas/blob/21bb277cc38b3364fd67a632c0bc7b7a6ffc9efd/etc/cas/config/cas.properties#L196-L199).
12980

130-
### Jib
81+
## Build and Run
13182

132-
The overlay embraces the [Jib Gradle Plugin](https://github.com/GoogleContainerTools/jib) to provide easy-to-use out-of-the-box tooling for building CAS docker images. Jib is an open-source Java containerizer from Google that lets Java developers build containers using the tools they know. It is a container image builder that handles all the steps of packaging your application into a container image. It does not require you to write a Dockerfile or have Docker installed, and it is directly integrated into the overlay.
83+
It is recommended to use the `Dockerfile` and the provided scripts to build and run CAS.
13384

13485
```bash
135-
./gradlew build jibDockerBuild
136-
```
137-
138-
### Dockerfile
139-
140-
You can also use the native Docker tooling and the provided `Dockerfile` to build and run CAS.
141-
142-
```bash
143-
chmod +x *.sh
14486
./docker-build.sh
14587
./docker-run.sh
14688
```
89+
90+
Refer to Apereo's [README.md](https://github.com/apereo/cas-overlay-template/tree/6.2#cas-overlay-template-) for more options.

0 commit comments

Comments
 (0)