[java-idp-oidc] branch main updated: JOIDC-83 - Admin flow to read/delete client registrations

Scott Cantor cantor.2 at osu.edu
Mon Mar 21 19:05:31 UTC 2022


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-idp-oidc.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-oidc.git;a=commit;h=3528082c8387ca57b9abdb61768a48ea8114f0a6

The following commit(s) were added to refs/heads/main by this push:
     new 3528082c JOIDC-83 - Admin flow to read/delete client registrations
3528082c is described below

commit 3528082c8387ca57b9abdb61768a48ea8114f0a6
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Mar 21 15:05:28 2022 -0400

    JOIDC-83 - Admin flow to read/delete client registrations
    
    https://shibboleth.atlassian.net/browse/JOIDC-83
    
    Add argument class and wrapper scripts.
---
 .../oidc/op/cli/ClientManagementArguments.java     | 60 ++++++++++++++++++++++
 .../idp/plugin/oidc/op/bin/oidc-clients.bat        |  4 ++
 .../idp/plugin/oidc/op/bin/oidc-clients.sh         |  9 ++++
 3 files changed, 73 insertions(+)

diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/cli/ClientManagementArguments.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/cli/ClientManagementArguments.java
new file mode 100644
index 00000000..61c5ba8c
--- /dev/null
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/cli/ClientManagementArguments.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.idp.plugin.oidc.op.cli;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.beust.jcommander.Parameter;
+
+import net.shibboleth.idp.cli.AbstractCommandLineArguments;
+
+/** Command line processing for OIDC client mgmt flow. */
+public class ClientManagementArguments extends AbstractCommandLineArguments {
+
+    /** EntityID. */
+    @Parameter(names = {"-c", "--clientId"}, required = true, description = "Client ID to query or destroy")
+    @Nullable private String clientId;
+
+    /** {@inheritDoc} */
+    @Override
+    protected StringBuilder doBuildURL(@Nonnull final StringBuilder builder) {
+        
+        if (getPath() == null) {
+            builder.append("/profile/admin/oidc/clients");
+        }
+        
+        if (builder.toString().contains("?")) {
+            builder.append('&');
+        } else {
+            builder.append('?');
+        }
+        
+        try {
+            builder.append("client_id=").append(URLEncoder.encode(clientId, "UTF-8"));
+        } catch (final UnsupportedEncodingException e) {
+            // UTF-8 is a required encoding. 
+        }
+        
+        return builder;
+    }
+        
+}
\ No newline at end of file
diff --git a/idp-oidc-extension-impl/src/main/resources/net/shibboleth/idp/plugin/oidc/op/bin/oidc-clients.bat b/idp-oidc-extension-impl/src/main/resources/net/shibboleth/idp/plugin/oidc/op/bin/oidc-clients.bat
new file mode 100644
index 00000000..e427988e
--- /dev/null
+++ b/idp-oidc-extension-impl/src/main/resources/net/shibboleth/idp/plugin/oidc/op/bin/oidc-clients.bat
@@ -0,0 +1,4 @@
+ at echo off
+setlocal
+
+"%~dp0\runclass.bat" -Dnet.shibboleth.idp.cli.arguments=net.shibboleth.idp.plugin.oidc.op.cli.ClientManagementArguments net.shibboleth.idp.cli.CLI %*
diff --git a/idp-oidc-extension-impl/src/main/resources/net/shibboleth/idp/plugin/oidc/op/bin/oidc-clients.sh b/idp-oidc-extension-impl/src/main/resources/net/shibboleth/idp/plugin/oidc/op/bin/oidc-clients.sh
new file mode 100644
index 00000000..b6b6b355
--- /dev/null
+++ b/idp-oidc-extension-impl/src/main/resources/net/shibboleth/idp/plugin/oidc/op/bin/oidc-clients.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+declare LOCATION
+
+LOCATION=$(dirname $0)
+
+$LOCATION/runclass.sh \
+    -Dnet.shibboleth.idp.cli.arguments=net.shibboleth.idp.plugin.oidc.op.cli.ClientManagementArguments \
+    net.shibboleth.idp.cli.CLI "$@"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list