diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 8dada3e..0000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed 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. diff --git a/Makefile b/Makefile deleted file mode 100644 index 52a4d91..0000000 --- a/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -DOC_FOLDER=target/site -DOC_BRANCH=gh-pages - -.PHONY: all doc test doc-folder doc-clean deploy - -all: test - -test: - mvn test - -deploy: - mvn clean deploy - -doc: doc-clean - mvn site - git checkout ${DOC_BRANCH} - git rm --ignore-unmatch -r * - cp -r ./${DOC_FOLDER}/* ./ - git add . - @echo --------------------- - @echo 'Please check the contents and do' - @echo '# git commit -m "updated docs" && git push manualy' - @echo 'then return to your original branch' - -doc-folder: - mkdir -p "${DOC_FOLDER}" - -doc-clean: doc-folder - rm -r "${DOC_FOLDER}" diff --git a/README.md b/README.md deleted file mode 100644 index ed9ab7f..0000000 --- a/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# Plugin SDK for Java - -If you are developing your own plugin for your Staffbase app we describe the authentication flow of a plugin at https://developers.staffbase.com/api/plugin-sso/. While this documentation just covers the conceptual ideas of the interface of plugins though – the so called Plugin SSO – we want to provide a library to help you develop your first plugin for Staffbase even faster. This SDK provides the basic functionality to parse and verify a provided token for Java. - -## Installation - -We provide our Plugin SDK via Maven Central Repository (https://oss.sonatype.org/content/repositories/snapshots/com/staffbase/). Thus, you can just use maven for installation: - -### Maven - -```xml - - com.staffbase - plugins-sdk-java - 1.0 - -``` - -### Gradle - -``` -dependencies { - compile 'com.staffbase:plugins-sdk-java:1.0' -} -``` - -## API Reference - -For the API reference of this SDK please consult the [docs](https://staffbase.github.io/plugins-sdk-java). - -## Code Example - -You can try to create a token from the received jwt. - -```java - import com.staffbase.plugins.sdk.sso.SSOData; - import com.staffbase.plugins.sdk.sso.SSOFacade; - - ... - - String jwToken = ... - RSAPublicKey rsaPublicKey = ... - - try { - final SSOFacade ssoFac = SSOFacade.create(rsaPublicKey); - final SSOData ssoData = ssoFac.verify(jwToken); - - request.setAttribute("instanceID", ssoData.getInstanceID()); - - return this.forward("/index.jsp"); - - } catch (final SSOException ssoException) { - - if (logger.isErrorEnabled()) { - logger.error("Verification of SSO attempt failed. Aborting.", ssoException); - } - - return this.forward("/errors/403-Forbidden.jsp"); - } -``` -## Contribution - -- Fork it -- Create a branch `git checkout -b feature-description` -- Put your name into authors.txt -- Commit your changes `git commit -am "Added ...."` -- Push to the branch `git push origin feature-description` -- Open a Pull Request - -## Running Tests - -To run the tests a simple `# mvn test` command in the root directory will suffice. - -## License - -Copyright 2017 Staffbase GmbH. - -Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 diff --git a/css/maven-base.css b/css/maven-base.css new file mode 100644 index 0000000..322efae --- /dev/null +++ b/css/maven-base.css @@ -0,0 +1,168 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF 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. + */ + +body { + margin: 0px; + padding: 0px; +} +table { + padding:0px; + width: 100%; + margin-left: -2px; + margin-right: -2px; +} +acronym { + cursor: help; + border-bottom: 1px dotted #feb; +} +table.bodyTable th, table.bodyTable td { + padding: 2px 4px 2px 4px; + vertical-align: top; +} +div.clear{ + clear:both; + visibility: hidden; +} +div.clear hr{ + display: none; +} +#bannerLeft, #bannerRight { + font-size: xx-large; + font-weight: bold; +} +#bannerLeft img, #bannerRight img { + margin: 0px; +} +.xleft, #bannerLeft img { + float:left; +} +.xright, #bannerRight { + float:right; +} +#banner { + padding: 0px; +} +#breadcrumbs { + padding: 3px 10px 3px 10px; +} +#leftColumn { + width: 170px; + float:left; + overflow: auto; +} +#bodyColumn { + margin-right: 1.5em; + margin-left: 197px; +} +#legend { + padding: 8px 0 8px 0; +} +#navcolumn { + padding: 8px 4px 0 8px; +} +#navcolumn h5 { + margin: 0; + padding: 0; + font-size: small; +} +#navcolumn ul { + margin: 0; + padding: 0; + font-size: small; +} +#navcolumn li { + list-style-type: none; + background-image: none; + background-repeat: no-repeat; + background-position: 0 0.4em; + padding-left: 16px; + list-style-position: outside; + line-height: 1.2em; + font-size: smaller; +} +#navcolumn li.expanded { + background-image: url(../images/expanded.gif); +} +#navcolumn li.collapsed { + background-image: url(../images/collapsed.gif); +} +#navcolumn li.none { + text-indent: -1em; + margin-left: 1em; +} +#poweredBy { + text-align: center; +} +#navcolumn img { + margin-top: 10px; + margin-bottom: 3px; +} +#poweredBy img { + display:block; + margin: 20px 0 20px 17px; +} +#search img { + margin: 0px; + display: block; +} +#search #q, #search #btnG { + border: 1px solid #999; + margin-bottom:10px; +} +#search form { + margin: 0px; +} +#lastPublished { + font-size: x-small; +} +.navSection { + margin-bottom: 2px; + padding: 8px; +} +.navSectionHead { + font-weight: bold; + font-size: x-small; +} +.section { + padding: 4px; +} +#footer { + padding: 3px 10px 3px 10px; + font-size: x-small; +} +#breadcrumbs { + font-size: x-small; + margin: 0pt; +} +.source { + padding: 12px; + margin: 1em 7px 1em 7px; +} +.source pre { + margin: 0px; + padding: 0px; +} +#navcolumn img.imageLink, .imageLink { + padding-left: 0px; + padding-bottom: 0px; + padding-top: 0px; + padding-right: 2px; + border: 0px; + margin: 0px; +} diff --git a/css/maven-theme.css b/css/maven-theme.css new file mode 100644 index 0000000..d3407e8 --- /dev/null +++ b/css/maven-theme.css @@ -0,0 +1,161 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF 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. + */ + +body { + padding: 0px 0px 10px 0px; +} +body, td, select, input, li{ + font-family: Verdana, Helvetica, Arial, sans-serif; + font-size: 13px; +} +code{ + font-family: Courier, monospace; + font-size: 13px; +} +a { + text-decoration: none; +} +a:link { + color:#36a; +} +a:visited { + color:#47a; +} +a:active, a:hover { + color:#69c; +} +#legend li.externalLink { + background: url(../images/external.png) left top no-repeat; + padding-left: 18px; +} +a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover { + background: url(../images/external.png) right center no-repeat; + padding-right: 18px; +} +#legend li.newWindow { + background: url(../images/newwindow.png) left top no-repeat; + padding-left: 18px; +} +a.newWindow, a.newWindow:link, a.newWindow:visited, a.newWindow:active, a.newWindow:hover { + background: url(../images/newwindow.png) right center no-repeat; + padding-right: 18px; +} +h2 { + padding: 4px 4px 4px 6px; + border: 1px solid #999; + color: #900; + background-color: #ddd; + font-weight:900; + font-size: x-large; +} +h3 { + padding: 4px 4px 4px 6px; + border: 1px solid #aaa; + color: #900; + background-color: #eee; + font-weight: normal; + font-size: large; +} +h4 { + padding: 4px 4px 4px 6px; + border: 1px solid #bbb; + color: #900; + background-color: #fff; + font-weight: normal; + font-size: large; +} +h5 { + padding: 4px 4px 4px 6px; + color: #900; + font-size: medium; +} +p { + line-height: 1.3em; + font-size: small; +} +#breadcrumbs { + border-top: 1px solid #aaa; + border-bottom: 1px solid #aaa; + background-color: #ccc; +} +#leftColumn { + margin: 10px 0 0 5px; + border: 1px solid #999; + background-color: #eee; + padding-bottom: 3px; /* IE-9 scrollbar-fix */ +} +#navcolumn h5 { + font-size: smaller; + border-bottom: 1px solid #aaaaaa; + padding-top: 2px; + color: #000; +} + +table.bodyTable th { + color: white; + background-color: #bbb; + text-align: left; + font-weight: bold; +} + +table.bodyTable th, table.bodyTable td { + font-size: 1em; +} + +table.bodyTable tr.a { + background-color: #ddd; +} + +table.bodyTable tr.b { + background-color: #eee; +} + +.source { + border: 1px solid #999; +} +dl { + padding: 4px 4px 4px 6px; + border: 1px solid #aaa; + background-color: #ffc; +} +dt { + color: #900; +} +#organizationLogo img, #projectLogo img, #projectLogo span{ + margin: 8px; +} +#banner { + border-bottom: 1px solid #fff; +} +.errormark, .warningmark, .donemark, .infomark { + background: url(../images/icon_error_sml.gif) no-repeat; +} + +.warningmark { + background-image: url(../images/icon_warning_sml.gif); +} + +.donemark { + background-image: url(../images/icon_success_sml.gif); +} + +.infomark { + background-image: url(../images/icon_info_sml.gif); +} + diff --git a/css/print.css b/css/print.css new file mode 100644 index 0000000..18fcbad --- /dev/null +++ b/css/print.css @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF 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. + */ + +#banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn { + display: none !important; +} +#bodyColumn, body.docs div.docs { + margin: 0 !important; + border: none !important +} diff --git a/css/site.css b/css/site.css new file mode 100644 index 0000000..055e7e2 --- /dev/null +++ b/css/site.css @@ -0,0 +1 @@ +/* You can override this file with your own styles */ \ No newline at end of file diff --git a/dependencies.html b/dependencies.html new file mode 100644 index 0000000..76f2b1c --- /dev/null +++ b/dependencies.html @@ -0,0 +1,481 @@ + + + + + + + + com.staffbase:plugins-sdk-java – Project Dependencies + + + + + + + + +
+ +
+
+
+
+

Project Dependencies

+

compile

+

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GroupIdArtifactIdVersionTypeLicenses
org.apache.logging.log4jlog4j-core2.17.0jarApache License, Version 2.0
org.apache.logging.log4jlog4j-jul2.17.0jarApache License, Version 2.0
org.apache.logging.log4jlog4j-slf4j-impl2.17.0jarApache License, Version 2.0
org.bitbucket.b_cjose4j0.7.9jarThe Apache Software License, Version 2.0
+

test

+

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

+ + + + + + + + + + + + + + + + + + +
GroupIdArtifactIdVersionTypeLicenses
junitjunit4.13.2jarEclipse Public License 1.0
org.mockitomockito-core4.2.0jarThe MIT License
+

Project Transitive Dependencies

+

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

+

compile

+

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

+ + + + + + + + + + + + + + + + + + +
GroupIdArtifactIdVersionTypeLicenses
org.apache.logging.log4jlog4j-api2.17.0jarApache License, Version 2.0
org.slf4jslf4j-api1.7.21jarMIT License
+

test

+

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GroupIdArtifactIdVersionTypeLicenses
net.bytebuddybyte-buddy1.12.4jarApache License, Version 2.0
net.bytebuddybyte-buddy-agent1.12.4jarApache License, Version 2.0
org.hamcresthamcrest-core1.3jarNew BSD License
org.objenesisobjenesis3.2jarApache License, Version 2.0
+

Project Dependency Graph

+ +
+

Dependency Tree

+
+

Licenses

+

The Apache License, Version 2.0: com.staffbase:plugins-sdk-java

+

Eclipse Public License 1.0: JUnit

+

MIT License: SLF4J API Module

+

The MIT License: mockito-core

+

Apache License, Version 2.0: Apache Log4j API, Apache Log4j Core, Apache Log4j JUL Adapter, Apache Log4j SLF4J Binding, Byte Buddy (without dependencies), Byte Buddy agent, Objenesis

+

New BSD License: Hamcrest Core

+

The Apache Software License, Version 2.0: jose4j

+

Dependency File Details

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FilenameSizeEntriesClassesPackagesJava VersionDebug Information
junit-4.13.2.jar384.6 kB389350321.5Yes
byte-buddy-1.12.4.jar3.8 MB2691263138-Yes
byte-buddy-agent-1.12.4.jar254.4 kB83652-Yes
log4j-api-2.17.0.jar301.8 kB2111779-Yes
log4j-core-2.17.0.jar1.8 MB12191126521.8Yes
log4j-jul-2.17.0.jar31 kB291411.8Yes
log4j-slf4j-impl-2.17.0.jar24.3 kB261021.8Yes
jose4j-0.7.9.jar275.7 kB236202201.7Yes
hamcrest-core-1.3.jar45 kB524531.5Yes
mockito-core-4.2.0.jar670.8 kB656584641.8Yes
objenesis-3.2.jar49.4 kB5943101.8Yes
slf4j-api-1.7.21.jar41.1 kB463441.5Yes
TotalSizeEntriesClassesPackagesJava VersionDebug Information
127.7 MB569752812371.812
compile: 6compile: 2.5 MBcompile: 1767compile: 1563compile: 88-compile: 6
test: 6test: 5.2 MBtest: 3930test: 3718test: 149-test: 6
+
+
+
+
+
+ + + diff --git a/dependency-info.html b/dependency-info.html new file mode 100644 index 0000000..b625398 --- /dev/null +++ b/dependency-info.html @@ -0,0 +1,106 @@ + + + + + + + + com.staffbase:plugins-sdk-java – Dependency Information + + + + + + + + +
+ +
+
+
+
+

Dependency Information

+

Apache Maven

+
+
<dependency>
+  <groupId>com.staffbase</groupId>
+  <artifactId>plugins-sdk-java</artifactId>
+  <version>1.2.4</version>
+</dependency>
+

Apache Buildr

+
+
'com.staffbase:plugins-sdk-java:jar:1.2.4'
+

Apache Ivy

+
+
<dependency org="com.staffbase" name="plugins-sdk-java" rev="1.2.4">
+  <artifact name="plugins-sdk-java" type="jar" />
+</dependency>
+

Groovy Grape

+
+
@Grapes(
+@Grab(group='com.staffbase', module='plugins-sdk-java', version='1.2.4')
+)
+

Gradle/Grails

+
+
compile 'com.staffbase:plugins-sdk-java:1.2.4'
+

Scala SBT

+
+
libraryDependencies += "com.staffbase" % "plugins-sdk-java" % "1.2.4"
+

Leiningen

+
+
[com.staffbase/plugins-sdk-java "1.2.4"]
+
+
+
+
+
+ + + diff --git a/distribution-management.html b/distribution-management.html new file mode 100644 index 0000000..5024c45 --- /dev/null +++ b/distribution-management.html @@ -0,0 +1,80 @@ + + + + + + + + com.staffbase:plugins-sdk-java – Project Distribution Management + + + + + + + + +
+ +
+
+
+
+

Overview

+

The following is the distribution management information used by this project.

+

Repository - ossrh

https://s01.oss.sonatype.org/service/local/staging/deploy/maven2
+

Snapshot Repository - ossrh

https://s01.oss.sonatype.org/content/repositories/snapshots
+
+
+
+
+
+ + + diff --git a/images/close.gif b/images/close.gif new file mode 100644 index 0000000..1c26bbc Binary files /dev/null and b/images/close.gif differ diff --git a/images/collapsed.gif b/images/collapsed.gif new file mode 100644 index 0000000..6e71084 Binary files /dev/null and b/images/collapsed.gif differ diff --git a/images/expanded.gif b/images/expanded.gif new file mode 100644 index 0000000..0fef3d8 Binary files /dev/null and b/images/expanded.gif differ diff --git a/images/external.png b/images/external.png new file mode 100644 index 0000000..3f999fc Binary files /dev/null and b/images/external.png differ diff --git a/images/icon_error_sml.gif b/images/icon_error_sml.gif new file mode 100644 index 0000000..61132ef Binary files /dev/null and b/images/icon_error_sml.gif differ diff --git a/images/icon_info_sml.gif b/images/icon_info_sml.gif new file mode 100644 index 0000000..c6cb9ad Binary files /dev/null and b/images/icon_info_sml.gif differ diff --git a/images/icon_success_sml.gif b/images/icon_success_sml.gif new file mode 100644 index 0000000..52e85a4 Binary files /dev/null and b/images/icon_success_sml.gif differ diff --git a/images/icon_warning_sml.gif b/images/icon_warning_sml.gif new file mode 100644 index 0000000..873bbb5 Binary files /dev/null and b/images/icon_warning_sml.gif differ diff --git a/images/logos/build-by-maven-black.png b/images/logos/build-by-maven-black.png new file mode 100644 index 0000000..919fd0f Binary files /dev/null and b/images/logos/build-by-maven-black.png differ diff --git a/images/logos/build-by-maven-white.png b/images/logos/build-by-maven-white.png new file mode 100644 index 0000000..7d44c9c Binary files /dev/null and b/images/logos/build-by-maven-white.png differ diff --git a/images/logos/maven-feather.png b/images/logos/maven-feather.png new file mode 100644 index 0000000..b5ada83 Binary files /dev/null and b/images/logos/maven-feather.png differ diff --git a/images/newwindow.png b/images/newwindow.png new file mode 100644 index 0000000..6287f72 Binary files /dev/null and b/images/newwindow.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..7dbe24c --- /dev/null +++ b/index.html @@ -0,0 +1,78 @@ + + + + + + + + com.staffbase:plugins-sdk-java – About + + + + + + + + +
+ +
+
+
+
+

About com.staffbase:plugins-sdk-java

+

A library to get your project integrated into the Staffbase app.

+
+
+
+
+
+ + + diff --git a/licenses.html b/licenses.html new file mode 100644 index 0000000..f577ca5 --- /dev/null +++ b/licenses.html @@ -0,0 +1,82 @@ + + + + + + + + com.staffbase:plugins-sdk-java – Project Licenses + + + + + + + + +
+ +
+
+
+
+

Overview

+

Typically the licenses listed for the project are that of the project itself, and not of dependencies.

+

Project Licenses

+

The Apache License, Version 2.0

+
+
-
+
+
+
+
+
+ + + diff --git a/plugin-management.html b/plugin-management.html new file mode 100644 index 0000000..bc3ddad --- /dev/null +++ b/plugin-management.html @@ -0,0 +1,98 @@ + + + + + + + + com.staffbase:plugins-sdk-java – Project Plugin Management + + + + + + + + +
+ +
+
+
+
+

Project Plugin Management

+ + + + + + + + + + + + + + + + + + + + +
GroupIdArtifactIdVersion
org.apache.maven.pluginsmaven-antrun-plugin1.3
org.apache.maven.pluginsmaven-assembly-plugin2.2-beta-5
org.apache.maven.pluginsmaven-dependency-plugin2.8
org.apache.maven.pluginsmaven-release-plugin2.5.3
+
+
+
+
+
+ + + diff --git a/plugins.html b/plugins.html new file mode 100644 index 0000000..2b99c79 --- /dev/null +++ b/plugins.html @@ -0,0 +1,140 @@ + + + + + + + + com.staffbase:plugins-sdk-java – Project Plugins + + + + + + + + +
+ +
+
+
+
+

Project Build Plugins

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GroupIdArtifactIdVersion
org.apache.maven.pluginsmaven-clean-plugin2.5
org.apache.maven.pluginsmaven-compiler-plugin3.8.1
org.apache.maven.pluginsmaven-deploy-plugin2.7
org.apache.maven.pluginsmaven-install-plugin2.4
org.apache.maven.pluginsmaven-jar-plugin2.4
org.apache.maven.pluginsmaven-javadoc-plugin3.3.1
org.apache.maven.pluginsmaven-project-info-reports-plugin3.1.2
org.apache.maven.pluginsmaven-resources-plugin2.6
org.apache.maven.pluginsmaven-site-plugin3.9.1
org.apache.maven.pluginsmaven-source-plugin3.2.1
org.apache.maven.pluginsmaven-surefire-plugin2.22.2
org.sonatype.pluginsnexus-staging-maven-plugin1.6.8
+

Project Report Plugins

+ + + + + + + + +
GroupIdArtifactIdVersion
org.apache.maven.pluginsmaven-project-info-reports-plugin3.1.2
+
+
+
+
+
+ + + diff --git a/pom.xml b/pom.xml deleted file mode 100644 index e3ad6c2..0000000 --- a/pom.xml +++ /dev/null @@ -1,201 +0,0 @@ - - - 4.0.0 - com.staffbase - plugins-sdk-java - 1.0.0-SNAPSHOT - jar - - ${project.groupId}:${project.artifactId} - - - A library to get your project integrated into the Staffbase app. - - https://github.com/Staffbase/plugins-sdk-java - - Staffbase - https://staffbase.com - - - - The Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - - - - scm:git:git://github.com/Staffbase/plugins-sdk-java.git - scm:git:ssh://github.com/Staffbase/plugins-sdk-java.git - http://github.com/Staffbase/plugins-sdk-java/tree/master - - - - Thilo Schmalfuß - thilo@staffbase.com - GMT+1 - Staffbase - https://staffbase.com - - DevOp - - - - Tilo Zemke - tilo@staffbase.com - GMT+1 - Staffbase - https://staffbase.com - - CTO - - - - Vitaliy Ivanov - vitaliy@staffbase.com - GMT+1 - Staffbase - https://staffbase.com - - Developer - - - - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2 - - - - UTF-8 - 1.8 - - com.staffbase.plugins.sdk;version=${project.version}, com.staffbase.plugins.sdk.*;version=${project.version} - - - com/staffbase/plugins/sdk - ${project.groupId}.json - 2.7.4 - 0.5.1 - 2.5 - 4.12 - 2.0.53-beta - - - - - com.fasterxml.jackson.core - jackson-core - ${jackson.version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - - - org.bitbucket.b_c - jose4j - ${jose4j.version} - - - - org.apache.logging.log4j - log4j-core - ${log4j.version} - - - org.apache.logging.log4j - log4j-slf4j-impl - ${log4j.version} - - - org.apache.logging.log4j - log4j-jul - ${log4j.version} - - - - junit - junit - ${junit.version} - test - - - - org.mockito - mockito-core - ${mockito.version} - test - - - - - - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - verify - - sign - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.19.1 - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.3 - true - - ossrh - https://oss.sonatype.org/ - - true - - - - - \ No newline at end of file diff --git a/project-info.html b/project-info.html new file mode 100644 index 0000000..54657a6 --- /dev/null +++ b/project-info.html @@ -0,0 +1,113 @@ + + + + + + + + com.staffbase:plugins-sdk-java – Project Information + + + + + + + + +
+ +
+
+
+
+

Project Information

+

This document provides an overview of the various documents and links that are part of this project's general information. All of this content is automatically generated by Maven on behalf of the project.

+

Overview

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DocumentDescription
DependenciesThis document lists the project's dependencies and provides information on each dependency.
Dependency InformationThis document describes how to include this project as a dependency using various dependency management tools.
Distribution ManagementThis document provides informations on the distribution management of this project.
AboutA library to get your project integrated into the Staffbase app.
LicensesThis document lists the project license(s).
Plugin ManagementThis document lists the plugins that are defined through pluginManagement.
PluginsThis document lists the build plugins and the report plugins used by this project.
Source Code ManagementThis document lists ways to access the online source repository.
SummaryThis document lists other related information of this project
TeamThis document provides information on the members of this project. These are the individuals who have contributed to the project in one form or another.
+
+
+
+
+
+ + + diff --git a/scm.html b/scm.html new file mode 100644 index 0000000..36b2dc4 --- /dev/null +++ b/scm.html @@ -0,0 +1,92 @@ + + + + + + + + com.staffbase:plugins-sdk-java – Source Code Management + + + + + + + + +
+ +
+
+
+
+

Overview

+

This project uses Git to manage its source code. Instructions on Git use can be found at https://git-scm.com/documentation.

+

Web Browser Access

+

The following is a link to a browsable version of the source repository:

+
+

Anonymous Access

+

The source can be checked out anonymously from Git with this command (See https://git-scm.com/docs/git-clone):

+
+
$ git clone git://github.com/Staffbase/plugins-sdk-java.git
+

Developer Access

+

Only project developers can access the Git tree via this method (See https://git-scm.com/docs/git-clone).

+
+
$ git clone ssh://github.com/Staffbase/plugins-sdk-java.git
+

Access from Behind a Firewall

+

Refer to the documentation of the SCM used for more information about access behind a firewall.

+
+
+
+
+
+ + + diff --git a/src/main/java/com/staffbase/plugins/sdk/sso/SSOData.java b/src/main/java/com/staffbase/plugins/sdk/sso/SSOData.java deleted file mode 100644 index 8f8d216..0000000 --- a/src/main/java/com/staffbase/plugins/sdk/sso/SSOData.java +++ /dev/null @@ -1,444 +0,0 @@ -/** - * SSO implementation, based on this doc: - * https://developers.staffbase.com/api/plugin-sso/ - * - * @copyright 2017 Staffbase GmbH. - * @author Thilo Schmalfuß - * @author Vitaliy Ivanov - * @license http://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/staffbase/plugins-sdk-java - */ -package com.staffbase.plugins.sdk.sso; - -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; - -import org.jose4j.jwt.JwtClaims; -import org.jose4j.jwt.MalformedClaimException; - -import com.staffbase.plugins.sdk.util.TextUtil; - -/** - * A container for the data transmitted from staffbase to a plugin using staffbase's - * single-sign-on methodology. - */ -public class SSOData { - - /********************************************** - * Constants - **********************************************/ - - /** - * The name of the role which is sent by staffbase to a plugin, if the requesting - * user may alter the plugin's contents, i.e. has an editing permission - * to the specific plugin instance. - */ - public static final String ROLE_EDITOR = "editor"; - - /** - * The key in the JWT claims for fetching the requested plugin instance's - * unique id. - */ - public static final String KEY_INSTANCE_ID = "instance_id"; - - /** - * The key in the JWT claims for fetching the requesting user's unique id. - */ - public static final String KEY_USER_ID = "sub"; - - /** - * The key in the JWT claims for fetching the requesting user's id in an - * external system. - */ - public static final String KEY_USER_EXTERNAL_ID = "external_id"; - - /** - * The key in the JWT claims for fetching the requesting user's first name. - */ - public static final String KEY_USER_FIRST_NAME = "given_name"; - - /** - * The key in the JWT claims for fetching the requesting users last name. - */ - public static final String KEY_USER_LAST_NAME = "family_name"; - - /** - * The key in the JWT claims for fetching the requesting users role. - */ - public static final String KEY_USER_ROLE = "role"; - - /** - * The key in the JWT claims for fetching the requesting user's locale - * settings. - */ - public static final String KEY_USER_LOCALE = "locale"; - - /** - * The key in the JWT claims for fetching the issuer name. - */ - public static final String KEY_ISSUER = "iss"; - - /** - * The key in the JWT claims for fetching the audience of the request. - */ - public static final String KEY_AUDIENCE = "aud"; - - /** - * The key in the JWT claims for fetching the requested plugin instance's - * name. - */ - public static final String KEY_INSTANCE_NAME = "instance_name"; - - /** - * The key in the JWT claims for fetching the requesting user's full - * name. - */ - public static final String KEY_USER_FULL_NAME = "name"; - - /** - * The key in the JWT claims for fetching the the type of the accessing - * entity. - */ - public static final String KEY_ENTITY_TYPE = "type"; - - /** - * The key in the JWT claims for fetching the color of the text that - * is configured in the Staffbase app. - */ - public static final String KEY_THEME_TEXT_COLOR = "theming_text"; - - /** - * The key in the JWT claims for fetching the color of the background - * that is configured in the Staffbase app. - */ - public static final String KEY_THEME_BACKGROUND_COLOR = "theming_bg"; - - /** - * The key in the JWT claims for fetching the list of tags - * that are configured in the Staffbase app. - */ - public static final String KEY_TAGS = "tags"; - - /********************************************** - * Members - **********************************************/ - - /** - * The unique id of the specific plugin instance that was requested using - * staffbase's SSO. - */ - private final String instanceID; - - /** - * The unique id of the staffbase user making the request to the plugin using staffbase's - * SSO. - */ - private final String userID; - - /** - * The id of the requesting user in an external system, if given. - */ - private final String userExternalID; - - /** - * The first, i.e. given name of the user making the request using staffbase's SSO. - */ - private final String userFirstName; - - /** - * The last, i.e. family name of the user making the request using staffbase's SSO. - */ - private final String userLastName; - - /** - * The name of the issuing authority for Stabase's SSO . - */ - private final String issuer; - - /** - * The name of the audience the staffbase's SSO data is dedicated. - */ - private final String audience; - - /** - * The Name of the specific plugin instance that was requested using - * staffbase's SSO. - */ - private final String instanceName; - - /** - * The full name of the user making the request using staffbase's SSO. - */ - private final String userFullName; - - /** - * the the type of the accessing entity making the request using staffbase's SSO. - */ - private final String entityType; - - /** - * The color of the text that is configured in the Staffbase app. - */ - private final String themeTextColor; - - /** - * The color of the background that is configured in the Staffbase app. - */ - private final String themeBackgroundColor; - - /** - * The tags that are configured in the Staffbase app. - */ - private final List tags; - - /** - * The locale of the user requesting the plugin instance. - * - * @see - * JDK 7 and JRE 7 Supported Locales - */ - private final String userLocale; - - /** - * The role of the user in regards of the requested {@link #instanceID}. If - * the requesting user does have editing permissions, this value is set to - * {@value #ROLE_EDITOR}. - * - * @see #instanceID - */ - private final String userRole; - - - /********************************************** - * Constructors - **********************************************/ - - public SSOData(final JwtClaims jwtClaims) throws MalformedClaimException { - - Objects.requireNonNull(jwtClaims); - - this.instanceID = jwtClaims.getClaimValue(KEY_INSTANCE_ID, String.class); - this.userID = jwtClaims.getClaimValue(KEY_USER_ID, String.class); - this.userExternalID = jwtClaims.getClaimValue(KEY_USER_EXTERNAL_ID, String.class); - this.userFirstName = jwtClaims.getClaimValue(KEY_USER_FIRST_NAME, String.class); - this.userLastName = jwtClaims.getClaimValue(KEY_USER_LAST_NAME, String.class); - this.userRole = jwtClaims.getClaimValue(KEY_USER_ROLE, String.class); - this.userLocale = jwtClaims.getClaimValue(KEY_USER_LOCALE, String.class); - this.issuer = jwtClaims.getClaimValue(KEY_ISSUER, String.class); - this.audience = jwtClaims.getClaimValue(KEY_AUDIENCE, String.class); - this.instanceName = jwtClaims.getClaimValue(KEY_INSTANCE_NAME, String.class); - this.userFullName = jwtClaims.getClaimValue(KEY_USER_FULL_NAME, String.class); - this.entityType = jwtClaims.getClaimValue(KEY_ENTITY_TYPE, String.class); - this.themeTextColor = jwtClaims.getClaimValue(KEY_THEME_TEXT_COLOR, String.class); - this.themeBackgroundColor = jwtClaims.getClaimValue(KEY_THEME_BACKGROUND_COLOR, String.class); - this.tags = jwtClaims.getClaimValue(KEY_TAGS, List.class); - } - - /********************************************** - * Getters - **********************************************/ - - /** - * Get the name of the issuing authority for Stabase's SSO . - * - * @see #issuer - * @return the name of the issuing authority - */ - public Optional getIssuer() { - return Optional.ofNullable(this.issuer); - } - - /** - * Get the name of the audience the staffbase's SSO data is dedicated. - * - * @see #audience - * @return the name of the audience the data is dedicated to - */ - public Optional getAudience() { - return Optional.ofNullable(this.audience); - } - - /** - * Get the Name of the specific plugin instance that was requested using - * staffbase's SSO. - * - * @see #instanceName - * @return the Name of the specific plugin instance - */ - public Optional getInstanceName() { - return Optional.ofNullable(this.instanceName); - } - - /** - * Get the full name of the user making the request using staffbase's SSO. - * - * @see #userFullName - * @return the full name of the user - */ - public Optional getUserFullName() { - return Optional.ofNullable(this.userFullName); - } - - /** - * Get the type of the accessing entity making the request using staffbase's SSO. - * - * @see #entityType - * @return type of the accessing entity - */ - public Optional getEntityType() { - return Optional.ofNullable(this.entityType); - } - - /** - * Get the color of the text that is configured in the Staffbase app. - * - * @see #themeTextColor - * @return the hex color of the text - */ - public Optional getThemeTextColor() { - return Optional.ofNullable(this.themeTextColor); - } - - /** - * Get the color of the background that is configured in the Staffbase app. - * - * @see #themeBackgroundColor - * @return the hex color of the background - */ - public Optional getThemeBackgroundColor() { - return Optional.ofNullable(this.themeBackgroundColor); - } - - /** - * Get the unique id of the specific plugin instance that was requested using - * staffbase's SSO. - * - * @see #instanceID - * @return requested plugin instance - */ - public String getInstanceID() { - return this.instanceID; - } - - /** - * Get the unique id of the staffbase user making the request to the plugin using - * staffbase's SSO. - * - * @see #userID - * @return the unique id of the requesting user - */ - public Optional getUserID() { - return Optional.ofNullable(this.userID); - } - - /** - * Get the id of the requesting user in an external system, if given. - * - * @see #userExternalID - * @return the requesting user's id in an external system - */ - public Optional getUserExternalID() { - return Optional.ofNullable(this.userExternalID); - } - - /** - * Get the first, i.e. given name of the user making the request using staffbase's - * SSO. - * - * @see #userFirstName - * @return the requesting user's first name - */ - public Optional getUserFirstName() { - return Optional.ofNullable(this.userFirstName); - } - - /** - * Get the last, i.e. family name of the user making the request using staffbase's - * SSO. - * - * @see #userLastName - * @return the requesting user's last name - */ - public Optional getUserLastName() { - return Optional.ofNullable(this.userLastName); - } - - /** - * Get the locale of the user requesting the plugin instance as the originally - * transmitted string. - * - * @see #userLocale - * @return the locale of the requesting user - */ - public Optional getUserLocaleAsString() { - return Optional.ofNullable(this.userLocale); - } - - /** - * Get the locale of the user requesting the plugin instance. - * - * @see #userLocale - * @return the locale of the requesting user - */ - public Optional getUserLocale() { - return TextUtil.parseLocale(this.userLocale); - } - - /** - * Get the role of the user in regards of the requested {@link #instanceID}. - * If the requesting user does have admin permissions, this value is set to - * {@value #ROLE_EDITOR}. - * - * @see #userRole - * @return the requesting user's access role - */ - public Optional getUserRole() { - return Optional.ofNullable(this.userRole); - } - - /** - * Check whether the requesting user is configured as an editor of the - * requested plugin instance. - * - * @see #userRole - * @return true if the requesting user is an editor. - */ - public boolean isEditor() { - return ROLE_EDITOR.equals(this.userRole); - } - - /** - * Get the tags of the user in regards of the requested {@link #instanceID}. - * If the requesting user does have admin permissions, this value is set to - * {@value #ROLE_EDITOR}. - * - * @see #tags - * @return the requesting user's tags - */ - public Optional> getTags() { - return Optional.ofNullable(this.tags); - } - - @Override - public String toString() { - return "SSOData ["+ - " instanceID="+ this.instanceID+ - ", userID="+ this.userID+ - ", userExternalID="+ this.userExternalID+ - ", userFirstName="+ this.userFirstName+ - ", userLastName="+ this.userLastName+ - ", userRole="+ this.userRole+ - ", userLocale="+ this.userLocale+ - ", issuer="+ this.issuer+ - ", audience="+ this.audience+ - ", instanceName="+ this.instanceName+ - ", userFullName="+ this.userFullName+ - ", entityType="+ this.entityType+ - ", themeTextColor="+ this.themeTextColor+ - ", themeBackgroundColor="+ this.themeBackgroundColor+ - " ]"; - } -} diff --git a/src/main/java/com/staffbase/plugins/sdk/sso/SSOException.java b/src/main/java/com/staffbase/plugins/sdk/sso/SSOException.java deleted file mode 100644 index 900ce50..0000000 --- a/src/main/java/com/staffbase/plugins/sdk/sso/SSOException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * SSO implementation, based on this doc: - * https://developers.staffbase.com/api/plugin-sso/ - * - * @copyright 2017 Staffbase GmbH. - * @author Thilo Schmalfuß - * @author Vitaliy Ivanov - * @license http://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/staffbase/plugins-sdk-java - */ - -package com.staffbase.plugins.sdk.sso; - -/** - * Special exception expressing issues in the verification process of a - * single-sign-on attempt with staffbase. - */ -public class SSOException extends Exception { - - /** - * @see java.io.Serializable - */ - private static final long serialVersionUID = 6803609782363892321L; - - - /********************************************** - * Constructors - **********************************************/ - - SSOException(final String message, final Throwable cause) { - super(message, cause); - } - - SSOException(final String message) { - super(message); - } -} diff --git a/src/main/java/com/staffbase/plugins/sdk/sso/SSOFacade.java b/src/main/java/com/staffbase/plugins/sdk/sso/SSOFacade.java deleted file mode 100644 index a28a8cc..0000000 --- a/src/main/java/com/staffbase/plugins/sdk/sso/SSOFacade.java +++ /dev/null @@ -1,180 +0,0 @@ -/** - * SSO implementation, based on this doc: - * https://developers.staffbase.com/api/plugin-sso/ - * - * @copyright 2017 Staffbase GmbH. - * @author Thilo Schmalfuß - * @author Vitaliy Ivanov - * @license http://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/staffbase/plugins-sdk-java - */ - -package com.staffbase.plugins.sdk.sso; - -import java.security.interfaces.RSAPublicKey; -import java.nio.charset.Charset; -import java.util.Objects; - - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import org.jose4j.jwa.AlgorithmConstraints; -import org.jose4j.jws.AlgorithmIdentifiers; -import org.jose4j.jwt.JwtClaims; -import org.jose4j.jwt.MalformedClaimException; -import org.jose4j.jwt.consumer.InvalidJwtException; -import org.jose4j.jwt.consumer.JwtConsumer; -import org.jose4j.jwt.consumer.JwtConsumerBuilder; - - - -/** - * Simple facade for handling staffbase's single-sign-on attempts and verifying the - * corresponding JWT data. - */ -public class SSOFacade { - - private static final Logger logger = LogManager.getLogger(SSOFacade.class); - - /** - * The name of the claim which holds the mandatory instance id for the - * single-sign-on attempt. - */ - public static final String EXPECTED_CLAIM_INSTANCE_ID = SSOData.KEY_INSTANCE_ID; - - /** - * Initialize the facade using the given RSA public key - * - * @param rsaPublicKey the RSA public key to be used for verification. - * - * @return the facade. - */ - public static SSOFacade create(final RSAPublicKey rsaPublicKey) { - - return new SSOFacade() - .initialize(rsaPublicKey); - } - - - /********************************************** - * Members - **********************************************/ - - /** - * The consumer instance to be used when validating single-sign-on attempt via - * JWT. - */ - private JwtConsumer jwtConsumer; - - - /********************************************** - * Constructors - **********************************************/ - - /** - * Private constructor. - */ - SSOFacade() { - } - - - /********************************************** - * Initialization - **********************************************/ - - /** - * Initialize this component by building up the consumer for JWT using the - * pre-configured secret - * - * @param rsaPublicKey the RSA public key to be used for verification. - * - * @return Fluent interface. - */ - SSOFacade initialize(final RSAPublicKey rsaPublicKey) { - - if (logger.isDebugEnabled()) { - logger.debug("Initializing single-sign-on manager SSOFacade. "); - } - - Objects.requireNonNull(rsaPublicKey); - - // Build up the algorithm constraints by only accepting RSA_USING_SHA256. - final AlgorithmConstraints algorithmConstraints = new AlgorithmConstraints( - AlgorithmConstraints.ConstraintType.WHITELIST, AlgorithmIdentifiers.RSA_USING_SHA256); - - this.jwtConsumer = new JwtConsumerBuilder() - .setJwsAlgorithmConstraints(algorithmConstraints) - .setSkipDefaultAudienceValidation() - .setVerificationKey(rsaPublicKey) - .setRequireExpirationTime() - .setRequireNotBefore() - .setRequireIssuedAt() - .build(); - - return this; - } - - - /********************************************** - * Methods - **********************************************/ - - /** - * Verify and parse a single-sign-on attempt coming from the staffbase app. - * - * @param raw the raw JWT string - * @return the parsed data from the sign-on attempt - * @throws SSOException if the verification of the sign-on attempt fails - */ - public SSOData verify(final String raw) throws SSOException { - - if (logger.isDebugEnabled()) { - logger.debug("Attempting to decrypt SSO JWT. " - + "[raw=" + raw + "]"); - } - - Objects.requireNonNull(raw); - - try { - - // Process and verify the request on the basis of jwt verification - final JwtClaims jwtClaims = this.jwtConsumer - .process(raw) - .getJwtClaims(); - - // Add the instance id verification step - final String instanceId = jwtClaims.getClaimValue(EXPECTED_CLAIM_INSTANCE_ID, String.class); - if (instanceId == null || instanceId.isEmpty()) { - if (logger.isFatalEnabled()) { - logger.fatal("Encountered illegal sso attempt. " - + "Bad instance_id. " - + "[instance_id=" + instanceId + "]"); - } - - throw new SSOException("Missing or malformed instnance_id."); - } - - if (logger.isDebugEnabled()) { - logger.debug("Verification of single-sign-on JWT succeeded. " - + "[raw=" + raw + "] " - + "[claims=" + jwtClaims + "]"); - } - - // Parse and return the container data. - return new SSOData(jwtClaims); - } catch (final MalformedClaimException malformationException) { - if (logger.isFatalEnabled()) { - logger.fatal("Encountered malformed sso attempt.", malformationException); - } - - throw new SSOException(malformationException.getMessage(), malformationException); - } catch (final InvalidJwtException invalidJwtException) { - if (logger.isFatalEnabled()) { - logger.fatal("Encountered illegal sso attempt.", invalidJwtException); - } - - throw new SSOException(invalidJwtException.getMessage(), invalidJwtException); - } - } -} diff --git a/src/main/java/com/staffbase/plugins/sdk/util/TextUtil.java b/src/main/java/com/staffbase/plugins/sdk/util/TextUtil.java deleted file mode 100644 index 728a7ff..0000000 --- a/src/main/java/com/staffbase/plugins/sdk/util/TextUtil.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * SSO implementation, based on this doc: - * https://developers.staffbase.com/api/plugin-sso/ - * - * @copyright 2017 Staffbase GmbH. - * @author Thilo Schmalfuß - * @license http://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/staffbase/plugins-sdk-java - */ - -package com.staffbase.plugins.sdk.util; - -import java.util.Locale; -import java.util.Optional; - -import com.staffbase.plugins.sdk.sso.SSOData; - -public class TextUtil { - - /** - * Parse a {@link Locale} from a string version as used in staffbase's SSO context. - * - * @see SSOData - * @param input the input string to parse, e.g. "de_DE" - * @return the parsed locale instance - */ - public static Optional parseLocale(final String input) { - if (input == null || input.isEmpty()) { - return Optional.empty(); - } - - return Optional.of(Locale.forLanguageTag(input.replace("_", "-"))); - } -} diff --git a/src/main/resources/log4j2.json b/src/main/resources/log4j2.json deleted file mode 100644 index c8774ea..0000000 --- a/src/main/resources/log4j2.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "configuration": { - "status": "WARN", - "shutdownHook": "disable", - "appenders": { - "Console": { - "name": "Console", - "target": "SYSTEM_OUT", - "PatternLayout": { - "pattern": "%-5level %d{ISO8601} [%t] %logger{36} - %msg%n" - } - } - }, - "loggers": { - "logger": [ - { - "name": "com.staffbase.plugins.sdk.sso", - "additivity": false, - "level": "debug", - "AppenderRef": { - "ref": "Console" - } - } - ], - "root": { - "level": "warn", - "AppenderRef": { - "ref": "Console" - } - } - } - } -} diff --git a/src/test/java/com/staffbase/plugins/sdk/sso/SSODataTest.java b/src/test/java/com/staffbase/plugins/sdk/sso/SSODataTest.java deleted file mode 100644 index 2bcc32e..0000000 --- a/src/test/java/com/staffbase/plugins/sdk/sso/SSODataTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * SSO implementation test, based on this doc: - * https://developers.staffbase.com/api/plugin-sso/ - * - * @copyright 2017 Staffbase GmbH. - * @author Thilo Schmalfuß - * @author Vitaliy Ivanov - * @license http://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/staffbase/plugins-sdk-java - */ - -package com.staffbase.plugins.sdk.sso; - -import static org.junit.Assert.fail; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import java.util.List; -import java.util.Locale; -import java.util.Arrays; - -import org.jose4j.jwt.JwtClaims; -import org.jose4j.jwt.MalformedClaimException; -import org.junit.Test; - - -public class SSODataTest { - - private static final String ROLE_EDITOR = "editor"; - - public static final String DATA_INSTANCE_ID = "55c79b6ee4b06c6fb19bd1e2"; - public static final String DATA_USER_ID = "541954c3e4b08bbdce1a340a"; - public static final String DATA_USER_EXTERNAL_ID = "jdoe"; - public static final String DATA_USER_FIRST_NAME = "John"; - public static final String DATA_USER_LAST_NAME = "Doe"; - public static final String DATA_USER_ROLE = "editor"; - public static final String DATA_USER_LOCALE = "en-US"; - public static final String DATA_ISSUER = "api.staffbase.com"; - public static final String DATA_AUDIENCE = "map"; - public static final String DATA_INSTANCE_NAME = "Our locations"; - public static final String DATA_USER_FULL_NAME = "John Doe"; - public static final String DATA_ENTITY_TYPE = "user"; - public static final String DATA_THEME_TEXT_COLOR = "#000000"; - public static final String DATA_THEME_BACKGROUND_COLOR = "#FFFFFF"; - public static final List DATA_TAGS = Arrays.asList("profile:tag1", "profile:tag2"); - - /** - * Test empty claims. - */ - @Test - public void testNullClaims() { - try { - final SSOData ssoData = new SSOData(null); - fail("Expected Exception not thrown."); - } catch (Exception e) {} - } - - /** - * Test claim accessors. - * @throws MalformedClaimException - */ - @Test - public void createWithJwtClaims() throws MalformedClaimException { - - final JwtClaims claims = mock(JwtClaims.class); - - when(claims.getClaimValue(SSOData.KEY_INSTANCE_ID, String.class)).thenReturn(DATA_INSTANCE_ID); - when(claims.getClaimValue(SSOData.KEY_USER_ID, String.class)).thenReturn(DATA_USER_ID); - when(claims.getClaimValue(SSOData.KEY_USER_EXTERNAL_ID, String.class)).thenReturn(DATA_USER_EXTERNAL_ID); - when(claims.getClaimValue(SSOData.KEY_USER_FIRST_NAME, String.class)).thenReturn(DATA_USER_FIRST_NAME); - when(claims.getClaimValue(SSOData.KEY_USER_LAST_NAME, String.class)).thenReturn(DATA_USER_LAST_NAME); - when(claims.getClaimValue(SSOData.KEY_USER_ROLE, String.class)).thenReturn(DATA_USER_ROLE); - when(claims.getClaimValue(SSOData.KEY_USER_LOCALE, String.class)).thenReturn(DATA_USER_LOCALE); - when(claims.getClaimValue(SSOData.KEY_ISSUER, String.class)).thenReturn(DATA_ISSUER); - when(claims.getClaimValue(SSOData.KEY_AUDIENCE, String.class)).thenReturn(DATA_AUDIENCE); - when(claims.getClaimValue(SSOData.KEY_INSTANCE_NAME, String.class)).thenReturn(DATA_INSTANCE_NAME); - when(claims.getClaimValue(SSOData.KEY_USER_FULL_NAME, String.class)).thenReturn(DATA_USER_FULL_NAME); - when(claims.getClaimValue(SSOData.KEY_ENTITY_TYPE, String.class)).thenReturn(DATA_ENTITY_TYPE); - when(claims.getClaimValue(SSOData.KEY_THEME_TEXT_COLOR, String.class)).thenReturn(DATA_THEME_TEXT_COLOR); - when(claims.getClaimValue(SSOData.KEY_THEME_BACKGROUND_COLOR, String.class)).thenReturn(DATA_THEME_BACKGROUND_COLOR); - when(claims.getClaimValue(SSOData.KEY_TAGS, List.class)).thenReturn(DATA_TAGS); - - final SSOData ssoData = new SSOData(claims); - - assertEquals(DATA_INSTANCE_ID, ssoData.getInstanceID()); - assertEquals(DATA_USER_ID, ssoData.getUserID().get()); - assertEquals(DATA_USER_EXTERNAL_ID, ssoData.getUserExternalID().get()); - assertEquals(DATA_USER_FIRST_NAME, ssoData.getUserFirstName().get()); - assertEquals(DATA_USER_LAST_NAME, ssoData.getUserLastName().get()); - assertEquals(DATA_USER_ROLE, ssoData.getUserRole().get()); - assertEquals(DATA_USER_LOCALE, ssoData.getUserLocaleAsString().get()); - - assertEquals(DATA_ISSUER, ssoData.getIssuer().get()); - assertEquals(DATA_AUDIENCE, ssoData.getAudience().get()); - assertEquals(DATA_INSTANCE_NAME, ssoData.getInstanceName().get()); - assertEquals(DATA_USER_FULL_NAME, ssoData.getUserFullName().get()); - assertEquals(DATA_ENTITY_TYPE, ssoData.getEntityType().get()); - assertEquals(DATA_THEME_TEXT_COLOR, ssoData.getThemeTextColor().get()); - assertEquals(DATA_THEME_BACKGROUND_COLOR, ssoData.getThemeBackgroundColor().get()); - assertEquals(DATA_TAGS, ssoData.getTags().get()); - - assertEquals(DATA_USER_ROLE.equals(ROLE_EDITOR), ssoData.isEditor()); - - assertEquals(Locale.US, ssoData.getUserLocale().get()); - } -} diff --git a/src/test/java/com/staffbase/plugins/sdk/sso/SSOFacadeTest.java b/src/test/java/com/staffbase/plugins/sdk/sso/SSOFacadeTest.java deleted file mode 100644 index dad2ea2..0000000 --- a/src/test/java/com/staffbase/plugins/sdk/sso/SSOFacadeTest.java +++ /dev/null @@ -1,341 +0,0 @@ -/** - * SSO implementation test, based on this doc: - * https://developers.staffbase.com/api/plugin-sso/ - * - * @copyright 2017 Staffbase GmbH. - * @author Vitaliy Ivanov - * @license http://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/staffbase/plugins-sdk-java - */ - -package com.staffbase.plugins.sdk.sso; - -import org.junit.Test; - -import static org.junit.Assert.fail; -import static org.junit.Assert.assertEquals; - -import org.jose4j.jwt.JwtClaims; -import org.jose4j.jwt.NumericDate; -import org.jose4j.jwk.RsaJsonWebKey; -import org.jose4j.jwk.RsaJwkGenerator; -import org.jose4j.jws.JsonWebSignature; -import org.jose4j.jws.AlgorithmIdentifiers; -import org.jose4j.lang.JoseException; - - -public class SSOFacadeTest { - - private static final String ROLE_EDITOR = "editor"; - - /** - * Generate a 2048 bits JSON web key. - * @return JSON web key - * @throws JoseException - */ - private RsaJsonWebKey generateRsaJwk() throws JoseException { - - return RsaJwkGenerator.generateJwk(2048); - } - - /** - * Create a JwtClaims object with prefilled sane defaults. - * @return JwtClaims - */ - private JwtClaims createDefaultClaims() { - - JwtClaims claims = new JwtClaims(); - - claims.setIssuer(SSODataTest.DATA_ISSUER); // who creates the token and signs it - claims.setAudience(SSODataTest.DATA_AUDIENCE); // to whom the token is intended to be sent - claims.setExpirationTimeMinutesInTheFuture(10); // time when the token will expire (10 minutes from now) - claims.setGeneratedJwtId(); // a unique identifier for the token - claims.setIssuedAtToNow(); // when the token was issued/created (now) - claims.setNotBeforeMinutesInThePast(2); // time before which the token is not yet valid (2 minutes ago) - claims.setSubject(SSODataTest.DATA_USER_ID); // the subject/principal is whom the token is about - claims.setClaim(SSOData.KEY_INSTANCE_ID, SSODataTest.DATA_INSTANCE_ID); // additional claims/attributes about the subject can be added - - return claims; - } - - /** - * Create a JwtClaims object with prefilled sane defaults and missing mandatory claims. - * @return JwtClaims - */ - private JwtClaims createMalformedClaims() { - - JwtClaims claims = new JwtClaims(); - - claims.setIssuer(SSODataTest.DATA_ISSUER); // who creates the token and signs it - claims.setGeneratedJwtId(); // a unique identifier for the token - claims.setSubject(SSODataTest.DATA_USER_ID); // the subject/principal is whom the token is about - claims.setClaim(SSOData.KEY_INSTANCE_ID, SSODataTest.DATA_INSTANCE_ID); // additional claims/attributes about the subject can be added - - return claims; - } - - /** - * Create a RSA256 signed token from given claims and RSA jwk. - * - * @param JwtClaims claims - * @param RsaJsonWebKey rsaJsonWebKey - * @return String - * @throws JoseException - */ - private String createSignedTokenFromClaims(JwtClaims claims, RsaJsonWebKey rsaJsonWebKey) throws JoseException { - - // A JWT is a JWS and/or a JWE with JSON claims as the payload. - // In this example it is a JWS so we create a JsonWebSignature object. - JsonWebSignature jws = new JsonWebSignature(); - - // The payload of the JWS is JSON content of the JWT Claims - jws.setPayload(claims.toJson()); - - // The JWT is signed using the private key - jws.setKey(rsaJsonWebKey.getPrivateKey()); - - // Set the signature algorithm on the JWT/JWS that will integrity protect the claims - jws.setAlgorithmHeaderValue(AlgorithmIdentifiers.RSA_USING_SHA256); - - return jws.getCompactSerialization(); - } - - /** - * Create a RSA384 signed token from given claims and RSA jwk. - * - * @param JwtClaims claims - * @param RsaJsonWebKey rsaJsonWebKey - * @return String - * @throws JoseException - */ - private String createUnsupportedSignedTokenFromClaims(JwtClaims claims, RsaJsonWebKey rsaJsonWebKey) throws JoseException { - - // A JWT is a JWS and/or a JWE with JSON claims as the payload. - // In this example it is a JWS so we create a JsonWebSignature object. - JsonWebSignature jws = new JsonWebSignature(); - - // The payload of the JWS is JSON content of the JWT Claims - jws.setPayload(claims.toJson()); - - // The JWT is signed using the private key - jws.setKey(rsaJsonWebKey.getPrivateKey()); - - // Set the signature algorithm on the JWT/JWS that will integrity protect the claims - jws.setAlgorithmHeaderValue(AlgorithmIdentifiers.RSA_USING_SHA384); - - return jws.getCompactSerialization(); - } - - /** - * Test unsupported signing algorithm. - * @throws JoseException - */ - @Test(expected=SSOException.class) - public void testUnsupportedSignToken() throws JoseException,SSOException { - - RsaJsonWebKey jwk = this.generateRsaJwk(); - JwtClaims claims = this.createDefaultClaims(); - String jwt = this.createUnsupportedSignedTokenFromClaims(claims,jwk); - - - final SSOFacade ssoFac = SSOFacade.create(jwk.getRsaPublicKey()); - ssoFac.verify(jwt); - - } - - /** - * Test proper signed token. - * @throws JoseException - */ - @Test - public void testProperSignedToken() throws JoseException, SSOException { - - RsaJsonWebKey jwk = this.generateRsaJwk(); - JwtClaims claims = this.createDefaultClaims(); - String jwt = this.createSignedTokenFromClaims(claims, jwk); - - final SSOFacade ssoFac = SSOFacade.create(jwk.getRsaPublicKey()); - ssoFac.verify(jwt); - } - - /** - * Test proper signed token. - * @throws JoseException - */ - @Test(expected=SSOException.class) - public void testProperSignedTokenWithDiffrentKey() throws JoseException, SSOException { - - RsaJsonWebKey jwk = this.generateRsaJwk(); - JwtClaims claims = this.createDefaultClaims(); - String jwt = this.createSignedTokenFromClaims(claims, jwk); - - jwk = this.generateRsaJwk(); - - - final SSOFacade ssoFac = SSOFacade.create(jwk.getRsaPublicKey()); - ssoFac.verify(jwt); - - } - - /** - * Test proper signed token missing mandatory claims. - * @throws JoseException - */ - @Test(expected=SSOException.class) - public void testMalformedCLaims() throws JoseException, SSOException { - - RsaJsonWebKey jwk = this.generateRsaJwk(); - JwtClaims claims = this.createMalformedClaims(); - - String jwt = this.createSignedTokenFromClaims(claims, jwk); - - final SSOFacade ssoFac = SSOFacade.create(jwk.getRsaPublicKey()); - ssoFac.verify(jwt); - - } - - /** - * Test proper signed token missing mandatory nbf claim. - * @throws JoseException - */ - @Test(expected=SSOException.class) - public void testMissingNBFCLaim() throws JoseException, SSOException { - - RsaJsonWebKey jwk = this.generateRsaJwk(); - JwtClaims claims = this.createMalformedClaims(); - - claims.setExpirationTimeMinutesInTheFuture(10); - claims.setIssuedAtToNow(); - //claims.setNotBeforeMinutesInThePast(2); - - String jwt = this.createSignedTokenFromClaims(claims, jwk); - - final SSOFacade ssoFac = SSOFacade.create(jwk.getRsaPublicKey()); - ssoFac.verify(jwt); - } - - /** - * Test proper signed token valid in an hour. - * @throws JoseException - */ - @Test(expected=SSOException.class) - public void testFutureNBFCLaim() throws JoseException, SSOException { - - RsaJsonWebKey jwk = this.generateRsaJwk(); - JwtClaims claims = this.createMalformedClaims(); - - NumericDate nbf = NumericDate.now(); - nbf.addSeconds(3600); - - claims.setExpirationTimeMinutesInTheFuture(10); - claims.setIssuedAtToNow(); - claims.setNotBefore(nbf); - - String jwt = this.createSignedTokenFromClaims(claims, jwk); - - final SSOFacade ssoFac = SSOFacade.create(jwk.getRsaPublicKey()); - ssoFac.verify(jwt); - } - - /** - * Test proper signed token missing mandatory iat claim. - * @throws JoseException - */ - @Test(expected=SSOException.class) - public void testMissingIATCLaim() throws JoseException, SSOException { - - RsaJsonWebKey jwk = this.generateRsaJwk(); - JwtClaims claims = this.createMalformedClaims(); - - claims.setExpirationTimeMinutesInTheFuture(10); - //claims.setIssuedAtToNow(); - claims.setNotBeforeMinutesInThePast(2); - - String jwt = this.createSignedTokenFromClaims(claims, jwk); - - final SSOFacade ssoFac = SSOFacade.create(jwk.getRsaPublicKey()); - ssoFac.verify(jwt); - } - - /** - * Test proper signed token missing mandatory exp claim. - * @throws JoseException - */ - @Test(expected=SSOException.class) - public void testMissingEXPCLaim() throws JoseException, SSOException { - - RsaJsonWebKey jwk = this.generateRsaJwk(); - JwtClaims claims = this.createMalformedClaims(); - - //claims.setExpirationTimeMinutesInTheFuture(10); - claims.setIssuedAtToNow(); - claims.setNotBeforeMinutesInThePast(2); - - String jwt = this.createSignedTokenFromClaims(claims, jwk); - - final SSOFacade ssoFac = SSOFacade.create(jwk.getRsaPublicKey()); - ssoFac.verify(jwt); - } - - /** - * Test proper signed token already expired. - * @throws JoseException - */ - @Test(expected=SSOException.class) - public void testPastEXPCLaim() throws JoseException, SSOException { - - RsaJsonWebKey jwk = this.generateRsaJwk(); - JwtClaims claims = this.createMalformedClaims(); - - NumericDate exp = NumericDate.now(); - exp.addSeconds(-3600); - - claims.setExpirationTime(exp); - claims.setIssuedAtToNow(); - claims.setNotBeforeMinutesInThePast(2); - - String jwt = this.createSignedTokenFromClaims(claims, jwk); - - final SSOFacade ssoFac = SSOFacade.create(jwk.getRsaPublicKey()); - ssoFac.verify(jwt); - } - - /** - * Test missing decryption key. - * @throws JoseException - */ - @Test(expected=NullPointerException.class) - public void testNullKey() throws JoseException, SSOException { - - final SSOFacade ssoFac = SSOFacade.create(null); - } - - /** - * Test missing jwt. - * @throws JoseException - */ - @Test(expected=NullPointerException.class) - public void testNullJwt() throws JoseException, SSOException { - - RsaJsonWebKey jwk = this.generateRsaJwk(); - - final SSOFacade ssoFac = SSOFacade.create(jwk.getRsaPublicKey()); - - ssoFac.verify(null); - } - - /** - * Test empty jwt. - * @throws JoseException - */ - @Test(expected=SSOException.class) - public void testEmptyJwt() throws JoseException, SSOException { - - RsaJsonWebKey jwk = this.generateRsaJwk(); - - final SSOFacade ssoFac = SSOFacade.create(jwk.getRsaPublicKey()); - - ssoFac.verify(""); - } -} - diff --git a/summary.html b/summary.html new file mode 100644 index 0000000..4b184ad --- /dev/null +++ b/summary.html @@ -0,0 +1,122 @@ + + + + + + + + com.staffbase:plugins-sdk-java – Project Summary + + + + + + + + + +
+
+
+

Project Summary

+

Project Information

+ + + + + + + + + + + + +
FieldValue
Namecom.staffbase:plugins-sdk-java
DescriptionA library to get your project integrated into the Staffbase app.
Homepagehttps://github.com/Staffbase/plugins-sdk-java
+

Project Organization

+ + + + + + + + + +
FieldValue
NameStaffbase
URLhttps://staffbase.com
+

Build Information

+ + + + + + + + + + + + + + + + + + +
FieldValue
GroupIdcom.staffbase
ArtifactIdplugins-sdk-java
Version1.2.4
Typejar
Java Version8
+
+
+
+
+
+ + + diff --git a/team.html b/team.html new file mode 100644 index 0000000..ec52957 --- /dev/null +++ b/team.html @@ -0,0 +1,116 @@ + + + + + + + + com.staffbase:plugins-sdk-java – Project Team + + + + + + + + + +
+
+
+

Project Team

+

A successful project requires many people to play many roles. Some members write code or documentation, while others are valuable as testers, submitting patches and suggestions.

+

The project team is comprised of Members and Contributors. Members have direct access to the source of a project and actively evolve the code-base. Contributors improve the project through submission of patches and suggestions to the Members. The number of Contributors to the project is unbounded. Get involved today. All contributions to the project are greatly appreciated.

+

Members

+

The following is a list of developers with commit privileges that have directly contributed to the project in one way or another.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ImageNameEmailOrganizationOrganization URLRolesTime Zone
Thilo Schmalfußthilo@staffbase.comStaffbasehttps://staffbase.comDevOpEurope/Berlin
Tilo Zemketilo@staffbase.comStaffbasehttps://staffbase.comCTOEurope/Berlin
Daniel Grossedaniel.grosse@staffbase.comStaffbasehttps://staffbase.comDeveloperEurope/Berlin
+

Contributors

+

There are no contributors listed for this project. Please check back again later.

+
+
+
+
+
+ + +