Skip to content

Commit b70aaa9

Browse files
committed
Merge branch 'release/21.0.0'
2 parents 21a847d + 9d3f224 commit b70aaa9

116 files changed

Lines changed: 4850 additions & 1004 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/workflows/build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 11
20+
- name: Cache SonarCloud packages
21+
uses: actions/cache@v1
22+
with:
23+
path: ~/.sonar/cache
24+
key: ${{ runner.os }}-sonar
25+
restore-keys: ${{ runner.os }}-sonar
26+
- name: Cache Gradle packages
27+
uses: actions/cache@v1
28+
with:
29+
path: ~/.gradle/caches
30+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
31+
restore-keys: ${{ runner.os }}-gradle
32+
- name: Build and analyze
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
35+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
36+
run: ./gradlew build sonarqube --info

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.
44

5+
21.0.0 (02-03-2020)
6+
===================
7+
8+
OSF CAS third release with web flow updates, institution SSO, and FE rework
9+
10+
* Login and logout web flow fixes and improvements
11+
* Fully functional institution SSO, BE and FE
12+
* FE rework and UI / UX improvements
13+
14+
Extra features
15+
16+
* Institution SSO migration
17+
* TOS consent check
18+
* SonarQube integraiton
19+
520
20.1.0 (11-05-2020)
621
===================
722

Dockerfile-local

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ RUN mkdir -p ~/.gradle \
1313
&& ./gradlew --version;
1414

1515
RUN cd cas-overlay && ./gradlew clean build --parallel --no-daemon;
16-
# The build process above in docker may takes a long time depending on your local resources. This OK if you only use
16+
# The build process above in docker may take a long time depending on your local resources. This OK if you only use
1717
# CAS by building it once. For local development, building in local shell or with your IDE such as IntelliJ is much
18-
# faster. Afterwards, simply comment out the above "RUN" command and enable the following "COPY" one. In fact, this
19-
# stage can be skipped if you have the WAR built locally. Just need run the second stage with a modified WAR source.
18+
# faster. Afterwards, simply comment out the above "RUN" command above and enable the "COPY" one below.
2019
# COPY ./build cas-overlay/build/
2120

21+
# In fact, the above "overlay" stage can be skipped if you have the WAR built locally. Simply run this second stage
22+
# "cas" with a modified WAR source.
2223
FROM adoptopenjdk/openjdk11:alpine-jre AS cas
2324

2425
LABEL "Organization"="Center for Open Science"
@@ -33,9 +34,9 @@ RUN cd / \
3334
COPY etc/cas/ /etc/cas/
3435

3536
COPY etc/cas/config/ /etc/cas/config/
36-
# Use "cas-local.properties" and "log4j2-local.xml" for local development
37-
RUN rm etc/cas/config/cas.properties
37+
# Use "cas-local.properties", "instn-authn-local.xsl" and "log4j2-local.xml" for local development
3838
COPY etc/cas/config/local/cas-local.properties etc/cas/config/cas.properties
39+
COPY etc/cas/config/local/instn-authn-local.xsl etc/cas/config/instn-authn.xsl
3940
COPY etc/cas/config/local/log4j2-local.xml etc/cas/config/log4j2.xml
4041
RUN rm -r etc/cas/config/local
4142

build.gradle

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ buildscript {
2323
classpath "gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:${project.jibVersion}"
2424
classpath "io.freefair.gradle:maven-plugin:${project.gradleMavenPluginVersion}"
2525
classpath "io.freefair.gradle:lombok-plugin:${project.gradleLombokPluginVersion}"
26+
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.1.1"
2627
}
2728
}
2829

@@ -58,8 +59,13 @@ def casWebApplicationBinaryName = "cas.war"
5859
project.ext."casServerVersion" = casServerVersion
5960
project.ext."casWebApplicationBinaryName" = casWebApplicationBinaryName
6061

62+
apply plugin: "war"
6163
apply plugin: "io.freefair.war-overlay"
6264

65+
apply from: rootProject.file("gradle/tasks.gradle")
66+
apply from: rootProject.file("gradle/springboot.gradle")
67+
apply from: rootProject.file("gradle/dockerjib.gradle")
68+
6369
apply plugin: "io.freefair.lombok"
6470
lombok {
6571
config["config.stopBubbling"] = "true"
@@ -70,14 +76,30 @@ lombok {
7076
config["lombok.toString.doNotUseGetters"] = "true"
7177
}
7278

73-
apply from: rootProject.file("gradle/tasks.gradle")
74-
75-
apply plugin: "war"
7679
apply plugin: "eclipse"
80+
eclipse {
81+
classpath {
82+
downloadSources = true
83+
downloadJavadoc = true
84+
}
85+
}
86+
7787
apply plugin: "idea"
88+
idea {
89+
module {
90+
downloadJavadoc = true
91+
downloadSources = true
92+
}
93+
}
7894

79-
apply from: rootProject.file("gradle/springboot.gradle")
80-
apply from: rootProject.file("gradle/dockerjib.gradle")
95+
apply plugin: "org.sonarqube"
96+
sonarqube {
97+
properties {
98+
property "sonar.projectKey", "CenterForOpenScience_osf-cas"
99+
property "sonar.organization", "centerforopenscience"
100+
property "sonar.host.url", "https://sonarcloud.io"
101+
}
102+
}
81103

82104
dependencies {
83105
// Other CAS dependencies/modules may be listed here...
@@ -123,6 +145,12 @@ dependencies {
123145

124146
// Google GSON
125147
implementation "com.google.code.gson:gson:${gsonVersion}"
148+
149+
// Javascript Object Signing and Encryption (JOSE) and JSON Web Tokens (JWT)
150+
implementation "com.nimbusds:nimbus-jose-jwt:${nimbusJoseVersion}"
151+
152+
// Apache HttpComponents Client fluent API
153+
implementation "org.apache.httpcomponents:fluent-hc:${fluentHcVersion}"
126154
}
127155

128156
tasks.findByName("jibDockerBuild")
@@ -146,17 +174,3 @@ configurations.all {
146174
}
147175
}
148176
}
149-
150-
eclipse {
151-
classpath {
152-
downloadSources = true
153-
downloadJavadoc = true
154-
}
155-
}
156-
157-
idea {
158-
module {
159-
downloadJavadoc = true
160-
downloadSources = true
161-
}
162-
}

docker-reload.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
1-
#!/bin/bash
1+
#!/bin/zsh
22

33
# Rebuild locally and replace the WAR
4+
echo "######## Rebuild & Replace WAR ########"
5+
echo "./gradlew clean build"
46
./gradlew clean build
7+
echo "docker cp ./build/libs/cas.war cas:/cas-overlay"
58
docker cp ./build/libs/cas.war cas:/cas-overlay
9+
echo "################# Done ################"
610

711
# Sync configuration files
12+
echo "########## Sync Config Files ##########"
13+
echo "docker exec -d cas sh -c \"rm -rf /etc/cas/config/*\""
814
docker exec -d cas sh -c "rm -rf /etc/cas/config/*"
15+
echo "docker cp ./etc/cas/config/local/cas-local.properties cas:/etc/cas/config/cas.properties"
916
docker cp ./etc/cas/config/local/cas-local.properties cas:/etc/cas/config/cas.properties
17+
echo "docker cp ./etc/cas/config/local/instn-authn-local.xsl cas:/etc/cas/config/instn-authn.xsl"
18+
docker cp ./etc/cas/config/local/instn-authn-local.xsl cas:/etc/cas/config/instn-authn.xsl
19+
echo "docker cp ./etc/cas/config/local/log4j2-local.xml cas:/etc/cas/config/log4j2.xml"
1020
docker cp ./etc/cas/config/local/log4j2-local.xml cas:/etc/cas/config/log4j2.xml
21+
echo "################# Done ################"
1122

1223
# Sync JSON registered service files
24+
echo "####### Sync Service Definition #######"
25+
echo "docker exec -d cas sh -c \"rm -rf /etc/cas/services/*\""
1326
docker exec -d cas sh -c "rm -rf /etc/cas/services/*"
27+
echo "docker cp ./etc/cas/services/local/. cas:/etc/cas/services"
1428
docker cp ./etc/cas/services/local/. cas:/etc/cas/services
29+
echo "################# Done ################"
1530

1631
# Restart the container
32+
echo "########## Restart Container ##########"
33+
echo "docker restart cas"
1734
docker restart cas
35+
echo "docker logs -f --tail 0 cas"
36+
echo "####### OSF CAS LOG STARTS HERE #######"
1837
docker logs -f --tail 0 cas

etc/cas/config/cas.properties

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ cas.server.prefix=${cas.server.name}
1515
# Tomcat Server
1616
#
1717
cas.server.tomcat.server-name=OSF CAS
18-
# Enable additional HTTP connections for the embedded Tomcat container (when SSL is enabled by default)
19-
# cas.server.tomcat.http.port=${TOMCAT_HTTP_PORT:80}
20-
# cas.server.tomcat.http.protocol=org.apache.coyote.http11.Http11NioProtocol
21-
# cas.server.tomcat.http.enabled=true
22-
# cas.server.tomcat.http.attributes=
23-
# e.g. cas.server.tomcat.http.attributes.{attribute-name}={attributeValue}
2418
########################################################################################################################
2519

2620
########################################################################################################################
@@ -64,6 +58,39 @@ cas.logout.confirm-logout=false
6458
cas.logout.remove-descendant-tickets=false
6559
########################################################################################################################
6660

61+
########################################################################################################################
62+
# OSF URLs
63+
########################################################################################################################
64+
# OSF
65+
#
66+
cas.authn.osf-url.home=https://{{ .Values.osfDomain }}/
67+
cas.authn.osf-url.dashboard=https://{{ .Values.osfDomain }}/dashboard/
68+
cas.authn.osf-url.login-with-next=https://{{ .Values.osfDomain }}/login?next=
69+
cas.authn.osf-url.logout=https://{{ .Values.osfDomain }}/logout/
70+
cas.authn.osf-url.resend-confirmation=https://{{ .Values.osfDomain }}/resend/
71+
cas.authn.osf-url.forgot-password=https://{{ .Values.osfDomain }}/forgotpassword/
72+
cas.authn.osf-url.forgot-password-institution=https://{{ .Values.osfDomain }}/forgotpassword-institution/
73+
cas.authn.osf-url.register=https://{{ .Values.osfDomain }}/register/
74+
cas.authn.osf-url.institutions-home=https://{{ .Values.osfDomain }}/institutions/
75+
########################################################################################################################
76+
77+
########################################################################################################################
78+
# OSF API Settings for Institution Authentication
79+
########################################################################################################################
80+
# Authentication Endpoint
81+
#
82+
cas.authn.osf-api.instn-authn-endpoint=https://{{ .Values.apiDomain }}/v2/institutions/auth/
83+
#
84+
# JWT / JWE secrets for signing and encrypting authentication request payload
85+
#
86+
cas.authn.osf-api.instn-authn-jwt-secret=${OSF_JWT_SECRET}
87+
cas.authn.osf-api.instn-authn-jwe-secret=${OSF_JWE_SECRET}
88+
#
89+
# Path of the XSL file for parsing and transforming XML authentication responses
90+
#
91+
cas.authn.osf-api.instn-authn-xsl-location=file:/etc/cas/institutions-auth.xsl
92+
########################################################################################################################
93+
6794
########################################################################################################################
6895
# OSF PostgreSQL Authentication
6996
# See: https://apereo.github.io/cas/6.2.x/installation/Configuring-Custom-Authentication.html
@@ -91,8 +118,6 @@ cas.authn.osf-postgres.jpa.dialect=${OSF_DB_HIBERNATE_DIALECT:io.cos.cas.osf.hib
91118
cas.jdbc.show-sql=false
92119
cas.jdbc.gen-ddl=true
93120
cas.jdbc.case-insensitive=false
94-
# cas.jdbc.physical-table-names=
95-
# e.g. cas.jdbc.physical-table-names.{table-name}={new-table-name}
96121
#
97122
# General JPA Settings
98123
#
@@ -204,13 +229,13 @@ cas.authn.pac4j.orcid.callback-url-type=QUERY_PARAMETER
204229
#
205230
# Delegation Client: CAS
206231
#
207-
cas.authn.pac4j.cas[0].login-url=https://accounts.staging.osf.io/login
208-
cas.authn.pac4j.cas[0].client-name=stage1cas
232+
cas.authn.pac4j.cas[0].login-url=https://bprdeis.cord.edu:8443/cas/login
233+
cas.authn.pac4j.cas[0].client-name=cord
209234
cas.authn.pac4j.cas[0].protocol=SAML
210235
cas.authn.pac4j.cas[0].callback-url-type=QUERY_PARAMETER
211236
#
212-
cas.authn.pac4j.cas[1].login-url=https://accounts.staging2.osf.io/login
213-
cas.authn.pac4j.cas[1].client-name=stage2cas
214-
cas.authn.pac4j.cas[1].protocol=CAS30
237+
cas.authn.pac4j.cas[1].login-url=https://stwcas.okstate.edu/cas/login
238+
cas.authn.pac4j.cas[1].client-name=okstate
239+
cas.authn.pac4j.cas[1].protocol=SAML
215240
cas.authn.pac4j.cas[1].callback-url-type=QUERY_PARAMETER
216241
########################################################################################################################

0 commit comments

Comments
 (0)