Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gaynor@illinois.edu authored and gaynor@illinois.edu committed Jun 28, 2024
1 parent a072660 commit 6c595cb
Show file tree
Hide file tree
Showing 24 changed files with 614 additions and 154 deletions.
6 changes: 0 additions & 6 deletions .idea/sqldialects.xml

This file was deleted.

528 changes: 426 additions & 102 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if [ -z ${QDL_HOME+x} ]; then
# If there is a local QDL install, update it.
java -jar "$OA4MP_QDL_DEPLOY/qdl-installer.jar" upgrade -dir $QDL_HOME -all;
fi
echo "building OA4MP installer"
echo "building OLD OA4MP installer"
cd "$OA4MP_ROOT/server-admin/src/main/scripts/installer"
./create-installer.sh
if [[ $? -ne 0 ]] ; then
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ if [[ $? -ne 0 ]] ; then
echo "could not build client-installer. See $OA4MP_ROOT/client-installer/client-installer.log"
exit 1
fi
cp target/client-installer-jar-with-dependencies.jar $OA4MP_SERVER_DEPLOY/client-installer.ja
cp target/client-installer-jar-with-dependencies.jar $OA4MP_SERVER_DEPLOY/client-installer.jar

echo "building QDL OA4MP tools..."
cd $QDL_OA2_TOOLS || exit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
* on 6/19/24 at 7:23 AM
*/
public class OA4MPClientInstaller extends WebInstaller {
@Override
protected String getSetup() {
return "/oa4mp/setup.yaml";
}
}
12 changes: 8 additions & 4 deletions client-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
<artifactId>servlet</artifactId>
<version>5.3-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.14.2.0</version>
</dependency>

<dependency>
<groupId>edu.uiuc.ncsa.myproxy</groupId>
Expand All @@ -74,12 +78,12 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<!-- <version>2.5</version>
<scope>provided</scope>-->
<!-- <version>2.5</version>
<scope>provided</scope>-->
</dependency>
</dependencies>

<build>
<finalName>client2</finalName>
<finalName>client2</finalName>
</build>
</project>
4 changes: 2 additions & 2 deletions oa4mp-server-oauth2/buildNumber.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Fri Jun 21 15:39:51 CDT 2024
buildNumber\\d*=12055
#Fri Jun 28 16:37:14 CDT 2024
buildNumber\\d*=12095
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,9 @@ protected void doRFC7523(HttpServletRequest request, HttpServletResponse respons
try {
jwtRunner.doAuthClaims();
} catch (Throwable throwable) {
OA2ServletUtils.handleScriptEngineException(this, getOA2SE(), throwable, createDebugger(serviceTransaction.getClient()), serviceTransaction, new XMLMap());
// NOTE at this point there is no "backup" possible if there is an error since this is starting the flow.
// Sending a null cues in the handler not to rollback.
OA2ServletUtils.handleScriptEngineException(this, getOA2SE(), throwable, createDebugger(serviceTransaction.getClient()), serviceTransaction, null);
}
issuerTransactionState = doAT(issuerTransactionState, client);
// Now, get the right signing key
Expand Down
4 changes: 2 additions & 2 deletions qdl/buildNumber.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Fri Jun 21 15:40:02 CDT 2024
buildNumber\\d*=12671
#Fri Jun 28 16:37:14 CDT 2024
buildNumber\\d*=12755
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public void loadQE(InputLine inputLine, String cfgName) throws Throwable {
super.loadQE(inputLine, cfgName);
} catch (MyConfigurationException mcx) {
// try to process it as a server config
// https://github.com/ncsa/oa4mp/issues/196
ConfigurationNode node = XMLConfigUtil.findConfiguration(inputLine.getNextArgFor(QDLConfigurationConstants.CONFIG_FILE_FLAG), cfgName, OA4MPConfigTags.COMPONENT);
OA2ConfigurationLoader sourceLoader = new OA2ConfigurationLoader<>(node);
OA2SE sourceSE = (OA2SE) sourceLoader.load();
Expand Down
57 changes: 56 additions & 1 deletion qdl/src/main/java/edu/uiuc/ncsa/oa2/qdl/clc/QDLCLC.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,64 @@ protected ConfigurationLoader<? extends AbstractEnvironment> figureOutLoader(Str

public static void main(String[] args) {
try {
runnit(args, new QDLCLC(null));
QDLCLC qdlclc = new QDLCLC(null);
setInstance(qdlclc);
qdlclc.runnit(args, qdlclc);
} catch (Throwable e) {
e.printStackTrace();
}
}
/*
try {
OA2CommandLineClient oa2CommandLineClient = new OA2CommandLineClient(null);
// oa2CommandLineClient.start(args);
oa2CommandLineClient.runnit(args, getInstance());
} catch (Throwable e) {
e.printStackTrace();
}
*/
protected void banner(){
bannerTimes();
}
protected void bannerLarge(){
say("\n" +
" \n" +
" ,ad8888ba, 88888888ba, 88 ,ad8888ba, 88 ,ad8888ba, \n" +
" d8\"' `\"8b 88 `\"8b 88 d8\"' `\"8b 88 d8\"' `\"8b \n" +
"d8' `8b 88 `8b 88 d8' 88 d8' \n" +
"88 88 88 88 88 88 88 88 \n" +
"88 88 88 88 88 88 88 88 \n" +
"Y8, \"88,,8P 88 8P 88 Y8, 88 Y8, \n" +
" Y8a. Y88P 88 .a8P 88 Y8a. .a8P 88 Y8a. .a8P \n" +
" `\"Y8888Y\"Y8a 88888888Y\"' 88888888888 `\"Y8888Y\"' 88888888888 `\"Y8888Y\"' \n" +
" \n" +
" \n");
}
protected void bannerDotMatrix(){
say("\n" +
"\n" +
"___oooo____oooooo____oo____________oooo___oo_________oooo___\n" +
"_oo____oo__oo____oo__oo__________oo____oo_oo_______oo____oo_\n" +
"oo______oo_oo_____oo_oo_________oo________oo______oo________\n" +
"oo___o__oo_oo_____oo_oo_________oo________oo______oo________\n" +
"_oo___ooo__oo____oo__oo__________oo____oo_oo_______oo____oo_\n" +
"___oooo_o__oooooo____ooooooo_______oooo___ooooooo____oooo___\n" +
"_________oo_________________________________________________\n" +
"\n");
}
protected void bannerTimes(){
say("\n" +
"\n" +
" .oooooo. oooooooooo. ooooo .oooooo. ooooo .oooooo. \n" +
" d8P' `Y8b `888' `Y8b `888' d8P' `Y8b `888' d8P' `Y8b \n" +
"888 888 888 888 888 888 888 888 \n" +
"888 888 888 888 888 888 888 888 \n" +
"888 888 888 888 888 888 888 888 \n" +
"`88b d88b 888 d88' 888 o `88b ooo 888 o `88b ooo \n" +
" `Y8bood8P'Ybd' o888bood8P' o888ooooood8 `Y8bood8P' o888ooooood8 `Y8bood8P' \n" +
" \n" +
" \n" +
" \n" +
"\n");
}
}
Binary file modified server-admin/src/main/docs/jwt-util.odt
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import edu.uiuc.ncsa.security.core.util.ConfigurationLoader;
import edu.uiuc.ncsa.security.core.util.MyLoggingFacade;
import edu.uiuc.ncsa.security.util.cli.CLIDriver;
import edu.uiuc.ncsa.security.util.cli.FormatUtil;
import edu.uiuc.ncsa.security.util.cli.HelpUtil;
import edu.uiuc.ncsa.security.util.cli.InputLine;
import org.apache.commons.lang.StringUtils;
Expand Down Expand Up @@ -63,7 +64,9 @@ public static void setInstance(OA2CommandLineClient instance) {

public static void main(String[] args) {
try {
runnit(args, getInstance());
OA2CommandLineClient oa2CommandLineClient = new OA2CommandLineClient(null);
// oa2CommandLineClient.start(args);
oa2CommandLineClient.runnit(args, getInstance());
} catch (Throwable e) {
e.printStackTrace();
}
Expand All @@ -76,11 +79,15 @@ public static void main(String[] args) {
* @param clc
* @throws Throwable
*/
protected static void runnit(String[] args, OA2CommandLineClient clc) throws Throwable {
protected void runnit(String[] args, OA2CommandLineClient clc) throws Throwable {
clc.start(args);
OA2CLCCommands usc = new OA2CLCCommands(clc.getMyLogger(), clc);
usc.setConfigFile(clc.getConfigFile());
CLIDriver cli = new CLIDriver(usc);
FormatUtil.setIoInterface(clc.getIOInterface());
CLIDriver cli = new CLIDriver(clc.getIOInterface());
cli.addCommands(usc);
cli.setLineCommentStart(COMMENT_START);
cli.setIOInterface(clc.getIOInterface());
usc.bootMessage();
cli.start();

Expand All @@ -95,9 +102,9 @@ public void start(String[] args) throws Exception {
say("Warning: no configuration file specified. type in 'load --help' to see how to load one.");
return;
}
about();
try {
initialize();
about();
} catch (Throwable mc) {
Throwable t = mc;
if(mc.getCause()!=null){
Expand All @@ -112,19 +119,38 @@ protected ConfigurationLoader<? extends AbstractEnvironment> figureOutLoader(Str
ConfigLoaderTool configLoaderTool = new ConfigLoaderTool();
return configLoaderTool.figureOutClientLoader(fileName, configName, getComponentName());
}
protected void banner(){
say(" \n" +
" .g8\"\"8q. db `7MMM. ,MMF'`7MM\"\"\"Mq. \n" +
".dP' `YM. ;MM: MMMb dPMM MM `MM.\n" +
"dM' `MM ,V^MM. ,AM M YM ,M MM MM ,M9 \n" +
"MM MM ,M `MM AVMM M Mb M' MM MMmmdM9 \n" +
"MM. ,MP AbmmmqMA ,W' MM M YM.P' MM MM \n" +
"`Mb. ,dP'A' VML ,W' MM M `YM' MM MM \n" +
" `\"bmmd\"'.AMA. .AMMA.AmmmmmMMmm .JML. `' .JMML..JMML. \n" +
" MM \n" +
" MM ");
/*
,ad8888ba, 88888888ba, 88 ,ad8888ba, 88 ,ad8888ba,
d8"' `"8b 88 `"8b 88 d8"' `"8b 88 d8"' `"8b
d8' `8b 88 `8b 88 d8' 88 d8'
88 88 88 88 88 88 88 88
88 88 88 88 88 88 88 88
Y8, "88,,8P 88 8P 88 Y8, 88 Y8,
Y8a. Y88P 88 .a8P 88 Y8a. .a8P 88 Y8a. .a8P
`"Y8888Y"Y8a 88888888Y"' 88888888888 `"Y8888Y"' 88888888888 `"Y8888Y"'
*/
}
public void about() {
int width = 60;
say(" \n" +
" .g8\"\"8q. db `7MMM. ,MMF'`7MM\"\"\"Mq. \n" +
".dP' `YM. ;MM: MMMb dPMM MM `MM.\n" +
"dM' `MM ,V^MM. ,AM M YM ,M MM MM ,M9 \n" +
"MM MM ,M `MM AVMM M Mb M' MM MMmmdM9 \n" +
"MM. ,MP AbmmmqMA ,W' MM M YM.P' MM MM \n" +
"`Mb. ,dP'A' VML ,W' MM M `YM' MM MM \n" +
" `\"bmmd\"'.AMA. .AMMA.AmmmmmMMmm .JML. `' .JMML..JMML. \n" +
" MM \n" +
" MM ");
banner();
String stars = StringUtils.rightPad("", width + 1, "*");
say(stars);
say(padLineWithBlanks("* OA4MP CLC (command line client)", width) + "*");
Expand All @@ -140,13 +166,6 @@ public void about() {
@Override
public boolean use(InputLine inputLine) throws Exception {
// No components so this is a stub.
/* String indent = " ";
if (inputLine.hasArg("test")) {
OA2CLCCommands usc = new OA2CLCCommands(getMyLogger(), (ClientEnvironment) getEnvironment());
CLIDriver cli = new CLIDriver(usc);
cli.start();
return true;
}*/
return false;
}
}
50 changes: 47 additions & 3 deletions server-admin/src/main/scripts/installer/cfg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,32 @@
<JSONWebKey defaultKeyID="${JWT_KEY_ID}">
<path><![CDATA[${OA4MP_HOME}etc/keys.jwk]]></path>
</JSONWebKey>
<!--
See https://oa4mp.org/server/configuration/device-flow-servlet-configuration.html
-->
<deviceFlowServlet
verificationURI="https://${OA4MP_HOST}/oauth2/device"
interval="5"
codeChars="0123456789ABCDEFX"
codeLength="12"
codeSeparator="+"
codePeriodLength="4"
/>
<!--
See https://oa4mp.org/common/configuration/scopes.html
-->
<scopes>
<scope>openid</scope>
<scope>email</scope>
<scope>profile</scope>
<!-- <scope>org.cilogon.userinfo</scope> -->
<scope>org.oa4mp:userinfo</scope>
<scope>org.cilogon.userinfo</scope>
<!-- <scope>org.oa4mp:userinfo</scope> -->
</scopes>
<!--
See https://oa4mp.org/server/configuration/authorization-servlet-configuration.html for a discussions
of these two possible authorization servlet configurations. The first is when using Tomcat
and the second is when proxying through another OAuth service (e.g. CILogon).
-->
<!--
<authorizationServlet useHeader="true"
requireHeader="true"
Expand All @@ -65,6 +84,11 @@
authorizationURI="https://${OA4MP_HOST}oauth2/authorize"
/>
-->
<!--
See https://oa4mp.org/common/configuration/derby-store.html
This uses a Derby file store. Note that this means you cannot use the CLI
when the service is running since the database can only have a single instance.
-->
<derby storeType="file"
path="${OA4MP_HOME}var/storage/server">
<transactions/>
Expand All @@ -75,6 +99,9 @@
<txStore/>
<voStore/>
</derby>
<!--
See https://oa4mp.org/server/configuration/client_management-configuration.html
-->
<clientManagement>
<api protocol="rfc7591"
enabled="true"
Expand All @@ -84,13 +111,18 @@
/>
<api protocol="rfc7592" enabled="true"/>
</clientManagement>
<!--
See https://oa4mp.org/common/configuration/logging.html
-->
<logging
logFileName="${OA4MP_HOME}log/server.log"
logName="oa4mp"
logSize="100000"
logFileCount="2"
debug="tue"/>

<!--
See https://oa4mp.org/server/configuration/qdl-config.html
-->
<qdl name="qdl-default"
enabled="true"
debug="info"
Expand Down Expand Up @@ -120,6 +152,18 @@
</module>
</modules>
</qdl>
<!--
See https://oa4mp.org/server/configuration/server-email.html
-->
<mail enabled="false"
username="YOUR_EMAIL_SERVER_LOGON_NAME"
password="YOUR_EMAIL_SERVER_PASSWORD"
server="YOUR_EMAIL_SERVER_ADDRESS"
recipients="RECIPIENT_0;RECIPIENT_1;...;RECIPIENT_N">
<messageTemplate>${OA4MP_HOME}etc/oa4mp-message.template</messageTemplate>
<subjectTemplate>${OA4P_HOME}etc/oa4mp-subject.template</subjectTemplate>
</mail>


</service>

Expand Down
Binary file modified server-admin/src/main/scripts/jwt-scripts.tar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,8 @@ public static void main(String[] args) {
}
}

@Override
protected String getSetup() {
return "/oa4mp/setup.yaml";
}
}
9 changes: 7 additions & 2 deletions server-installer/src/main/scripts/create_server_cfg.qdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ docs. ≔[];
docs1.≔[];
setup.≔[];
jar. ≔[];
jar.'type'≔'jar';
jar.'sourceURL'≔'https://github.com/ncsa/qdl/releases/tag/v1.5.5';
jar.'type'≔'zip';
jar.'sourceURL'≔'https://github.com/ncsa/qdl/releases/download/v1.5.5/';
jar_entry.0.'target_dir'≔ '/';
jar_entry.0.'files'≔['qdl-installer.jar'];
jar_entry.0.'ignore'≔['/META-INF/',
'/edu/',
'/dir_list.txt',
'/file_list.txt'];
jar.'directories'≔jar_entry.;
docs.'type'≔'file_set';
docs.'sourceURL' := 'https://github.com/ncsa/oa4mp/blob/v5.5/docs/pdf/';
Expand Down
Loading

0 comments on commit 6c595cb

Please sign in to comment.