Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New saml 0530 metadata #3139

Closed
wants to merge 205 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
dd91275
remove: SAML extension library dependency
swalchemist Jan 24, 2024
316af55
Ignore non-functioning SAML tests
swalchemist Feb 13, 2024
65ac33b
update @Ignore - test now compiles
swalchemist Feb 23, 2024
38b3d94
feat: switch to new Spring Security SAML library
swalchemist Feb 27, 2024
2d6d669
feat: Supply metadata through /saml/metadata
Tallicia Mar 13, 2024
1cefd02
fix: handle case when Servlet Path is null and ensures test WithHttp…
Tallicia Mar 13, 2024
2deef93
remove: SAML extension library dependency
swalchemist Jan 24, 2024
843b0ce
Ignore non-functioning SAML tests
swalchemist Feb 13, 2024
9416e40
feat: Supply metadata through /saml/metadata
Tallicia Mar 13, 2024
56d7cec
fix: handle case when Servlet Path is null and ensures test WithHttp…
Tallicia Mar 13, 2024
fbd23c9
feat: reliably serve SAML SP metadata
peterhaochen47 Mar 20, 2024
81a12a4
Ignore failing SAML test
peterhaochen47 Mar 20, 2024
236a34c
disable docs test that shouldn't be running
swalchemist Mar 25, 2024
044b790
Ignore failing SAML test
swalchemist Mar 26, 2024
d8d2bfd
refactor: shorten the dummy IDP metadata
swalchemist Mar 26, 2024
89f268f
fix: "invalid XML" error in tests
peterhaochen47 Mar 26, 2024
c572972
wip: configure some metadata params
peterhaochen47 Mar 26, 2024
5fcd361
disable failing test
swalchemist Apr 1, 2024
a5fa5d8
WIP
bruce-ricard Apr 2, 2024
a4fdec9
wip
bruce-ricard Apr 4, 2024
2c2cfc9
wip: ensuring the endpoint for metadata works both in forward and dir…
Tallicia Apr 9, 2024
82d048b
add metadata redirect test
bruce-ricard Apr 11, 2024
f3655b5
wip: ensuring the saml metadata endpoint for metadata works in Mock M…
Tallicia Apr 16, 2024
5ea4e2b
wip: entityID assertion works in testSamlMetadataDefault
swalchemist Apr 16, 2024
fe0ec2d
feat: entity_id assertion passes
swalchemist Apr 16, 2024
c6f79af
wip: use working metadata path temporarily
swalchemist Apr 16, 2024
5883f8e
wip: xml refactor
swalchemist Apr 16, 2024
900c423
wip: updating to non forwarding for /saml/metadata to the example def…
Tallicia Apr 16, 2024
e4d72f7
wip: Ensuring the WantsAssertionSigned and AuthnRequestsSigned are po…
Tallicia Apr 18, 2024
8aa2fd9
wip: Adding in signature elements for SAML metadata.xml endpoint payload
Tallicia Apr 18, 2024
7839fa2
wip: Adding in signature elements for SAML metadata.xml endpoint payload
Tallicia Apr 19, 2024
f1fb4ec
feat: populate SAMP SP metadata fields: entityID, NameIDFormat, Authn…
duanemay Apr 22, 2024
d344e43
refactor: clean up commented out code
peterhaochen47 Apr 22, 2024
59b6605
Ignore non-functioning SAML tests
peterhaochen47 Apr 22, 2024
1fd65d9
Update opensaml libraries to 4.x
duanemay Apr 23, 2024
32607ed
Refactor annotations and formatting
duanemay Apr 23, 2024
6800b09
Refactor tests: formatting, andExpectAll and assertThat
duanemay Apr 23, 2024
8dcdfd6
Change from SAML XML to Java Config
duanemay Apr 23, 2024
f42f575
feat: populate sp metadata field WantAssertionsSigned
duanemay Apr 23, 2024
a9debd7
feat: saml sp metadata field - signing cert
peterhaochen47 Apr 24, 2024
0f259fc
feat: saml sp metadata encryption cert
peterhaochen47 Apr 24, 2024
7861a78
refactor: consolidate saml sp configs
peterhaochen47 Apr 24, 2024
1fa24ad
refactor: use lombok
peterhaochen47 Apr 24, 2024
a43bacd
refactor: simplify lombok annotation
peterhaochen47 Apr 24, 2024
c29b447
fix: maintain existing saml sp metadata file name
peterhaochen47 Apr 24, 2024
0e9837a
fix: saml sp metadata test set up
peterhaochen47 Apr 25, 2024
09685a8
fix: SAML SP metadata endpoint and its https redirect
hsinn0 Apr 30, 2024
2daf1bc
Clean up unnecssary codes
hsinn0 Apr 30, 2024
e4de3eb
Load the Saml Provider Data
hsinn0 May 1, 2024
a4a37a9
refactor: Spring Annotations on SamlRelyingPartyRegistrationRepository
duanemay May 7, 2024
b075cbd
fix: multiple versions of the opensaml library
duanemay May 8, 2024
c3a2068
feat: send SAML authn request to IDP
peterhaochen47 May 10, 2024
6fbbdaf
update saml link on login page
duanemay May 13, 2024
8eb263a
fix: issue with 2 JsonObjects imported
duanemay May 14, 2024
7d75dff
Merge SamlConfigProps to single class
duanemay May 14, 2024
88f9e4a
Update SamlLoginIT
duanemay May 14, 2024
da67d4d
feat: Saml Login redirects to IDP
duanemay May 14, 2024
cb31d22
fix: click first saml link matching text
duanemay May 17, 2024
2054d0f
feat: AssertionConsumerService SAML user login
duanemay May 22, 2024
00665f9
Clean up and reenable tests
duanemay May 29, 2024
44a8d57
Improve Testing of SAML Request/Response
duanemay Jun 3, 2024
a3fc3f6
Break up AuthProvider
duanemay Jun 11, 2024
538233f
Pull in OpenSaml4AuthenticationProvider
duanemay Jun 17, 2024
f2d6a42
Verify user attributes, roles, user name, email extraction
duanemay Jun 24, 2024
8f3bc78
Add editor and lombok config
duanemay Jun 24, 2024
6d6beea
Run kill_uaa as part of integrationTests
duanemay Jun 24, 2024
48a6cc1
Annotate Disabled tests with more information
duanemay Jun 25, 2024
0fe1b04
feat: SAML Logout
duanemay Jun 27, 2024
5ae1b3e
fix Selenium HomePage can be one of two urls.
duanemay Jul 5, 2024
5455ef6
Update BootstrapTests
duanemay Jul 5, 2024
f331940
feature: Zone-aware SAML SP metadata
hsinn0 Jul 5, 2024
52a4894
Disable `findByRegistrationIdWhenNoneFound` test as the assertion is …
hsinn0 Jul 5, 2024
eb5baeb
Update counter script
duanemay Jul 8, 2024
cdc6590
Update IdentityZone related classes and tests
duanemay Jul 8, 2024
748f5f2
feat: basic SAML SP metadata for non-default ID zone
duanemay Jul 8, 2024
c1a3677
wip: zoned metadata fixes and zoned login
peterhaochen47 Jul 12, 2024
114af0c
Merge remote-tracking branch 'refs/remotes/origin/develop' into new-s…
strehle Jul 16, 2024
8998521
rebase and revert entiyID checks
strehle Jul 16, 2024
a4455e7
Merge branch 'develop' into new-saml-0530
peterhaochen47 Jul 16, 2024
96bce18
Enable some passing SamlLoginIT tests
peterhaochen47 Jul 16, 2024
f248b1a
refactor entityId and entityIdAlias resolution
peterhaochen47 Jul 16, 2024
6182292
Merge branch 'develop' into new-saml-0530
peterhaochen47 Jul 16, 2024
fe383e4
backfill some SAML tests
peterhaochen47 Jul 16, 2024
57db423
Enable SAML Automatic Redirect
duanemay Jul 17, 2024
61752af
build(deps): bump org.gradle:test-retry-gradle-plugin
dependabot[bot] Jul 16, 2024
79286e0
Fix regression in identity-provider endpoint (#2962)
strehle Jul 18, 2024
56668db
build(deps): bump k8s.io/client-go from 0.30.2 to 0.30.3 in /k8s (#2964)
dependabot[bot] Jul 18, 2024
f551b40
Replace SamlLegacyAliasResponseForwardingFilter
peterhaochen47 Jul 18, 2024
54eb154
Merge branch 'develop' into new-saml-0530
peterhaochen47 Jul 18, 2024
2c91ee8
fix: correct test expectation
peterhaochen47 Jul 18, 2024
99af302
Merge branch 'develop' into new-saml-0530
duanemay Jul 19, 2024
6fac772
Update test classes
duanemay Jul 19, 2024
09b30ee
Update scripts for testing
duanemay Jul 22, 2024
5ee57e1
check entityId in validate SAML (#2970)
strehle Jul 23, 2024
ae14c2f
feat: Handle Multiple SAML keys
duanemay Jul 24, 2024
88033f1
fix: Couple of failing test cases due to `500 INTERNAL_SERVER_ERROR` …
hsinn0 Jul 25, 2024
f61f842
Merge pull request #2978 from cloudfoundry/new-saml-fix-oauth-token-e…
duanemay Jul 26, 2024
8f682fa
Merge remote-tracking branch 'origin/develop' into new-saml-0530
duanemay Jul 26, 2024
053f7b7
Clean up and reimplement SamlKeyManager and SamlKeyManagerFactory
duanemay Jul 26, 2024
d878109
Migrate tests from ZoneAwareMetadataGeneratorTests
duanemay Jul 29, 2024
0f5567e
feature: Handle icorrect SAML response
hsinn0 Jul 31, 2024
e376f3f
Merge pull request #2988 from cloudfoundry/new-saml-auth-failure-handler
duanemay Aug 1, 2024
5639565
Merge remote-tracking branch 'origin/develop' into new-saml-0530
duanemay Aug 1, 2024
6f4beda
Remove duplicate tests
duanemay Aug 1, 2024
c59e230
Add signatures to Metadata and AuthnRequest
duanemay Aug 1, 2024
3f5f5a8
Add tests for alternate config of signRequest and signMetaData
duanemay Aug 2, 2024
48eae87
Enable tests in BootstrapSamlIdentityProviderDataTests
duanemay Aug 2, 2024
ba5dfc9
Enable test in HomeControllerViewTests
duanemay Aug 5, 2024
3c5ed78
feat: Allow InResponseTo checking to be configured
duanemay Aug 6, 2024
18c8818
Merge branch 'develop' into new-saml-0530
duanemay Aug 6, 2024
3786026
feat: Add NameIdFormat to AuthnRequest
duanemay Aug 7, 2024
2239057
Support for login.saml.socket.* settings
duanemay Aug 8, 2024
a9817a7
Merge branch 'develop' into new-saml-0530
duanemay Aug 8, 2024
5d3cac2
Only show failed tests
duanemay Aug 12, 2024
6c8b795
Caffeine Caching
duanemay Aug 12, 2024
d4c4c5e
Log Malformed Saml Responses
duanemay Aug 12, 2024
c05fe37
Clean up and Sonar
duanemay Aug 13, 2024
99255f9
Merge remote-tracking branch 'origin/develop' into new-saml-0530
duanemay Aug 13, 2024
493e3ee
Merge remote-tracking branch 'origin' into new-saml-0530
duanemay Aug 20, 2024
1e2f024
Update to LoginInfoEndpoint
duanemay Aug 20, 2024
29693bb
Add Oauth Token endpoint to metadata
duanemay Aug 21, 2024
ee64060
Update tests
duanemay Aug 21, 2024
a4f74bf
Merge remote-tracking branch 'origin' into new-saml-0530
duanemay Aug 23, 2024
658d271
Resolve Sonar security hotspots
duanemay Aug 23, 2024
dbbd346
Correct malformed property placeholder.
duanemay Aug 23, 2024
cdd5fba
Merge remote-tracking branch 'origin/develop' into new-saml-0530
duanemay Sep 23, 2024
fe06d4f
Update JavaPluginExtension settings
duanemay Sep 25, 2024
eaac889
Implement Saml2 Bearer Grants
duanemay Sep 25, 2024
75b95ff
Merge remote-tracking branch 'origin/develop' into new-saml-0530
duanemay Sep 26, 2024
6931e01
Merge remote-tracking branch 'origin/develop' into new-saml-0530
duanemay Sep 26, 2024
0067298
Unjava-doc-ify the copyright notices
duanemay Sep 26, 2024
efb7e6c
Fix tests for Invitations and Passcodes
duanemay Sep 27, 2024
03b50d7
Sonar fixes
duanemay Oct 3, 2024
b2517f1
Update tests with awaitility
duanemay Oct 3, 2024
8cf3b9d
Update discovery urls to authenticate
duanemay Oct 4, 2024
485bf3c
Merge remote-tracking branch 'origin/develop' into new-saml-0530
duanemay Oct 7, 2024
8b05365
Enable tests and update disabled reasons for remaining
duanemay Oct 9, 2024
d2b1cfd
Merge remote-tracking branch 'origin/develop' into new-saml-0530
duanemay Oct 9, 2024
504879e
Enable RelayState as a redirect target
duanemay Oct 18, 2024
b1e0602
Merge remote-tracking branch 'origin/develop' into new-saml-0530
duanemay Oct 18, 2024
f105d8f
Update selenium page objects to use assert notation
duanemay Oct 18, 2024
f65c09e
Fix Sonar Issues
duanemay Oct 18, 2024
706e4a0
doc: Update the comment for `login.entityBaseURL` property.
hsinn0 Oct 25, 2024
f29075e
build(deps): bump versions.springSecurityVersion from 5.8.14 to 5.8.1…
dependabot[bot] Oct 21, 2024
e0575a5
build(deps): bump org.apache.velocity:velocity-engine-core (#3090)
dependabot[bot] Oct 22, 2024
5913029
pr/upgrade docs slate gems take 2 (#3091)
fhanik Oct 23, 2024
1a67351
build(deps): bump k8s.io/client-go from 0.31.1 to 0.31.2 in /k8s (#3096)
dependabot[bot] Oct 24, 2024
11e2bbf
Merge remote-tracking branch 'origin/develop' into new-saml-0530
duanemay Oct 28, 2024
dd4fff2
Fix Sonar Issues
duanemay Oct 29, 2024
03d9fa1
Improve test coverage
duanemay Nov 1, 2024
1f01d49
Cleanup and test coverage
duanemay Nov 1, 2024
e5813c0
fix(k8s): fix `JAVA_HOME`
achrinza Oct 23, 2024
11ade57
build(deps): bump rexml from 3.3.8 to 3.3.9 in /uaa/slate (#3100)
dependabot[bot] Oct 28, 2024
2af0631
build(deps): bump versions.jacksonVersion from 2.18.0 to 2.18.1 (#3101)
dependabot[bot] Oct 29, 2024
d0d9eea
build(deps): bump versions.seleniumVersion from 4.25.0 to 4.26.0
dependabot[bot] Oct 30, 2024
6bc0dfe
build(deps): bump github.com/onsi/gomega from 1.34.2 to 1.35.0 in /k8s
dependabot[bot] Oct 30, 2024
b3d43df
build(deps): bump github.com/onsi/gomega from 1.35.0 to 1.35.1 in /k8…
dependabot[bot] Nov 1, 2024
87a77bb
Cleanup not used comments and fragments
strehle Nov 4, 2024
bdd3bbb
Merge remote-tracking branch 'origin/develop' into new-saml-0530
strehle Nov 4, 2024
1975bd3
Delete server/src/test/java/org/cloudfoundry/identity/uaa/login/AddBc…
strehle Nov 4, 2024
21e9324
Delete server/src/test/java/org/cloudfoundry/identity/uaa/login/SamlL…
strehle Nov 4, 2024
ce787a0
Delete server/src/main/java/org/cloudfoundry/identity/uaa/provider/sa…
strehle Nov 4, 2024
a512bd8
Delete server/src/main/java/org/cloudfoundry/identity/uaa/provider/sa…
strehle Nov 4, 2024
468c4f3
Delete server/src/main/java/org/cloudfoundry/identity/uaa/provider/sa…
strehle Nov 4, 2024
22c582c
Delete server/src/main/java/org/cloudfoundry/identity/uaa/provider/sa…
strehle Nov 4, 2024
8e933d3
Delete server/src/main/java/org/cloudfoundry/identity/uaa/provider/sa…
strehle Nov 4, 2024
0505f87
Merge pull request #3109 from cloudfoundry/new-saml-0530-rebase
strehle Nov 4, 2024
f7bf484
Enable simpleSamlLoginWithAddShadowUserOnLoginFalse
duanemay Nov 6, 2024
f9a920d
Add coverage for UaaSavedRequestAwareAuthenticationSuccessHandler
duanemay Nov 6, 2024
97d6858
Merge remote-tracking branch 'origin/develop' into new-saml-0530
duanemay Nov 6, 2024
5a98fda
Fix Sonar issues
duanemay Nov 7, 2024
711f431
sonar recommendation
strehle Nov 7, 2024
2d6b885
sonar recommendation
strehle Nov 7, 2024
a94c660
sonar says not in use
strehle Nov 7, 2024
cc59526
Merge pull request #3113 from cloudfoundry/new-saml-0530-not-in-use
duanemay Nov 7, 2024
57be436
Remove duplicates in New-saml-0530 (#3117)
strehle Nov 8, 2024
06c110d
Merge remote-tracking branch 'origin/develop' into new-saml-0530
strehle Nov 8, 2024
26ade66
fix rebase
strehle Nov 8, 2024
6fa5a1d
Store saml session index in UaaSamlPrincipal
strehle Nov 11, 2024
530e885
return plain error message (#3119)
strehle Nov 11, 2024
5faaeb4
Disable csrf check in SAML-SLO (#3123)
strehle Nov 12, 2024
f872cb7
Merge remote-tracking branch 'origin/develop' into new-saml-0530-saml…
strehle Nov 12, 2024
da1b1f2
Merge remote-tracking branch 'origin/new-saml-0530' into new-saml-053…
strehle Nov 12, 2024
8f99520
fix integration test
strehle Nov 12, 2024
2ca7bae
fix integration test
strehle Nov 12, 2024
acf805d
Merge pull request #3122 from cloudfoundry/new-saml-0530-saml-session…
strehle Nov 12, 2024
115fff6
Add acr value into User Authentication (#3127)
strehle Nov 12, 2024
3c012b2
Merge remote-tracking branch 'origin/develop' into new-saml-0530
strehle Nov 12, 2024
403d642
Cleanup shadow library (#3130)
strehle Nov 12, 2024
78e21ba
Cleanup libraries not needed anymore (#3129)
strehle Nov 12, 2024
4a6cdc6
Merge remote-tracking branch 'origin/develop' into new-saml-0530
strehle Nov 13, 2024
c127bbb
sonar issue
strehle Nov 13, 2024
f36bd79
remove not needed method
strehle Nov 13, 2024
ca9e360
Add test to run Authn with redirect binding
strehle Nov 13, 2024
6fb8135
minor sonar issue
strehle Nov 13, 2024
71b4429
cleanup not used code
strehle Nov 13, 2024
9ebac66
sonar issue with unspecified type
strehle Nov 13, 2024
d02c5dd
Fix Sonar issues
duanemay Nov 13, 2024
d281b28
Enhancements for SAML2 bearer flow (#3132)
strehle Nov 15, 2024
e22d1d1
Merge remote-tracking branch 'origin/develop' into new-saml-0530
strehle Nov 15, 2024
e084cee
Enhancements for SAML2 bearer and IdP initiated SSO (#3136)
strehle Nov 16, 2024
bdb80e5
sonar: unused imports
strehle Nov 16, 2024
946a6f9
sonar: recommendation
strehle Nov 16, 2024
e54b489
sonar: recommendation
strehle Nov 16, 2024
4b22ca6
omit hard coded example name
strehle Nov 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,815 changes: 1,815 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

25 changes: 22 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ allprojects {

subprojects {
apply(plugin: "java")
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

configurations.all {
exclude(group: "org.hamcrest", module: "hamcrest-all")
Expand All @@ -64,6 +68,24 @@ subprojects {
exclude(group: "org.apache.directory.server", module: "apacheds-protocol-ldap")
exclude(group: "org.skyscreamer", module: "jsonassert")
exclude(group: "com.vaadin.external.google", module: "android-json")
exclude(group: "com.unboundid.components", module: "json")

// Exclude opensaml-security-api and non-FIPS bouncycastle libs, and use Shadow library for FIPS compliance
exclude(group: "org.bouncycastle", module: "bcpkix-jdk15on")
exclude(group: "org.bouncycastle", module: "bcprov-jdk15on")
exclude(group: "org.bouncycastle", module: "bcutil-jdk15on")
exclude(group: "org.bouncycastle", module: "bcprov-jdk18on")
exclude(group: "org.bouncycastle", module: "bcpkix-jdk18on")
exclude(group: "org.bouncycastle", module: "bcutil-jdk18on")

resolutionStrategy {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.opensaml' && details.requested.name.startsWith("opensaml-")) {
details.useVersion "${versions.opensaml}"
details.because 'Spring Security 5.8.x allows OpenSAML 3 or 4. OpenSAML 3 has reached its end-of-life. Spring Security 6 drops support for 3, using 4.'
}
}
}
}

dependencies {
Expand All @@ -81,9 +103,6 @@ subprojects {

[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:none", "-nowarn"]

java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17

test {
maxParallelForks = 1
// when failFast = true AND retry is on, there is a serious issue:
Expand Down
21 changes: 13 additions & 8 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ ext {
// Versions shared between multiple dependencies
versions.aspectJVersion = "1.9.4"
versions.apacheDsVersion = "2.0.0.AM27"
versions.bouncyCastleVersion = "2.0.0"
versions.bouncyCastleFipsVersion = "2.0.0"
versions.bouncyCastlePkixFipsVersion = "2.0.7"
versions.bouncyCastleTlsFipsVersion = "2.0.19"
versions.hamcrestVersion = "3.0"
versions.springBootVersion = "2.7.18"
versions.springFrameworkVersion = "5.3.39"
Expand All @@ -18,6 +20,8 @@ versions.seleniumVersion = "4.26.0"
versions.braveVersion = "6.0.3"
versions.jacksonVersion = "2.18.1"
versions.jsonPathVersion = "2.9.0"
versions.awaitilityVersion = "4.2.2"
versions.opensaml = "4.0.1" // Spring Security 5.8.x allows OpenSAML 3 or 4. OpenSAML 3 has reached its end-of-life. Spring Security 6 drops support for 3, using 4.

// Versions we're overriding from the Spring Boot Bom (Dependabot does not issue PRs to bump these versions, so we need to manually bump them)
ext["mariadb.version"] = "2.7.12" // Bumping to v3 breaks some pipeline jobs (and compatibility with Amazon Aurora MySQL), so pinning to v2 for now. v2 (current version) is stable and will be supported until about September 2025 (https://mariadb.com/kb/en/about-mariadb-connector-j/).
Expand All @@ -43,8 +47,10 @@ libraries.apacheDsProtocolLdap = "org.apache.directory.server:apacheds-protocol-
libraries.apacheLdapApi = "org.apache.directory.api:api-ldap-model:2.1.7"
libraries.aspectJRt = "org.aspectj:aspectjrt"
libraries.aspectJWeaver = "org.aspectj:aspectjweaver"
libraries.bouncyCastlePkix = "org.bouncycastle:bcpkix-fips:2.0.7"
libraries.bouncyCastleProv = "org.bouncycastle:bc-fips:${versions.bouncyCastleVersion}"
libraries.awaitility = "org.awaitility:awaitility:${versions.awaitilityVersion}"
libraries.bouncyCastlePkixFips = "org.bouncycastle:bcpkix-fips:${versions.bouncyCastlePkixFipsVersion}"
libraries.bouncyCastleFipsProv = "org.bouncycastle:bc-fips:${versions.bouncyCastleFipsVersion}"
libraries.bouncyCastleTlsFips = "org.bouncycastle:bctls-fips:${versions.bouncyCastleTlsFipsVersion}"
libraries.braveInstrumentationSpringWebmvc = "io.zipkin.brave:brave-instrumentation-spring-webmvc:${versions.braveVersion}"
libraries.braveContextSlf4j = "io.zipkin.brave:brave-context-slf4j:${versions.braveVersion}"
libraries.commonsCodec = "commons-codec:commons-codec:1.17.1"
Expand Down Expand Up @@ -78,6 +84,7 @@ libraries.lombok = "org.projectlombok:lombok"
libraries.mariaJdbcDriver = "org.mariadb.jdbc:mariadb-java-client"
libraries.mockito = "org.mockito:mockito-core"
libraries.mockitoJunit5 = "org.mockito:mockito-junit-jupiter"
libraries.openSamlApi = "org.opensaml:opensaml-saml-api:${versions.opensaml}"
libraries.passay = "org.passay:passay:1.6.6"
libraries.postgresql = "org.postgresql:postgresql:42.7.4"
libraries.selenium = "org.seleniumhq.selenium:selenium-java:${versions.seleniumVersion}"
Expand All @@ -103,7 +110,7 @@ libraries.springRetry = "org.springframework.retry:spring-retry"
libraries.springSecurityConfig = "org.springframework.security:spring-security-config:${versions.springSecurityVersion}"
libraries.springSecurityCore = "org.springframework.security:spring-security-core:${versions.springSecurityVersion}"
libraries.springSecurityLdap = "org.springframework.security:spring-security-ldap:${versions.springSecurityVersion}"
libraries.springSecuritySaml = "org.springframework.security.extensions:spring-security-saml2-core:${versions.springSecuritySamlVersion}"
libraries.springSecuritySamlServiceProvider = "org.springframework.security:spring-security-saml2-service-provider:${versions.springSecurityVersion}"
libraries.springSecurityTaglibs = "org.springframework.security:spring-security-taglibs:${versions.springSecurityVersion}"
libraries.springSecurityTest = "org.springframework.security:spring-security-test:${versions.springSecurityVersion}"
libraries.springSecurityWeb = "org.springframework.security:spring-security-web:${versions.springSecurityVersion}"
Expand All @@ -123,12 +130,10 @@ libraries.tomcatJasperEl = "org.apache.tomcat.embed:tomcat-embed-jasper:${versio
libraries.tomcatJdbc = "org.apache.tomcat:tomcat-jdbc:${versions.tomcatCargoVersion}"
libraries.unboundIdLdapSdk = "com.unboundid:unboundid-ldapsdk"
libraries.unboundIdScimSdk = "com.unboundid.product.scim:scim-sdk:1.8.26"
libraries.velocity = "org.apache.velocity:velocity-engine-core:2.4.1"
libraries.xerces = "xerces:xercesImpl:2.12.2"
libraries.nimbusJwt = "com.nimbusds:nimbus-jose-jwt:9.47"
libraries.xmlSecurity = "org.apache.santuario:xmlsec:4.0.3"
libraries.xmlUnit = "org.xmlunit:xmlunit-assertj:2.10.0"
libraries.orgJson = "org.json:json:20240303"
libraries.owaspEsapi = "org.owasp.esapi:esapi:2.5.5.0"
libraries.jodaTime = "joda-time:joda-time:2.13.0"
libraries.apacheHttpClient = "org.apache.httpcomponents:httpclient:4.5.14"

Expand All @@ -138,4 +143,4 @@ libraries.cargoGradlePlugin = "com.bmuschko:gradle-cargo-plugin:2.9.0"
libraries.springBootGradlePlugin = "org.springframework.boot:spring-boot-gradle-plugin:${versions.springBootVersion}"
libraries.springDependencyMangementGradlePlugin = "io.spring.gradle:dependency-management-plugin"
libraries.gradleJcocoPlugin = "org.barfuin.gradle.jacocolog:gradle-jacoco-log:3.1.0"
libraries.sonarqubePlugin = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:5.1.0.4882"
libraries.sonarqubePlugin = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:5.1.0.4882"
1 change: 1 addition & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.Map;

public class JsonUtils {
private static ObjectMapper objectMapper = new ObjectMapper();
private static final ObjectMapper objectMapper = new ObjectMapper();

public static String writeValueAsString(Object object) throws JsonUtilException {
try {
Expand Down Expand Up @@ -67,7 +67,7 @@ public static Map<String, Object> readValueAsMap(final String input) {

public static <T> T readValue(byte[] data, Class<T> clazz) throws JsonUtilException {
try {
if (data!=null && data.length>0) {
if (data != null && data.length > 0) {
return objectMapper.readValue(data, clazz);
} else {
return null;
Expand All @@ -91,7 +91,7 @@ public static <T> T readValue(String s, TypeReference<T> typeReference) {

public static <T> T readValue(byte[] data, TypeReference<T> typeReference) {
try {
if (data!=null && data.length>0) {
if (data != null && data.length > 0) {
return objectMapper.readValue(data, typeReference);
} else {
return null;
Expand Down Expand Up @@ -134,20 +134,18 @@ public static JsonNode readTree(String s) {
}

public static class JsonUtilException extends RuntimeException {

private static final long serialVersionUID = -4804245225960963421L;

public JsonUtilException(Throwable cause) {
super(cause);
}

}

public static String serializeExcludingProperties(Object object, String... propertiesToExclude) {
String serialized = JsonUtils.writeValueAsString(object);
Map<String, Object> properties = JsonUtils.readValue(serialized, new TypeReference<Map<String, Object>>() {});
for(String property : propertiesToExclude) {
if(property.contains(".")) {
Map<String, Object> properties = JsonUtils.readValue(serialized, new TypeReference<>() {});
for (String property : propertiesToExclude) {
if (property.contains(".")) {
String[] split = property.split("\\.", 2);
if (properties != null && properties.containsKey(split[0])) {
Object inner = properties.get(split[0]);
Expand Down Expand Up @@ -180,19 +178,19 @@ public static boolean getNodeAsBoolean(JsonNode node, String fieldName, boolean
public static Date getNodeAsDate(JsonNode node, String fieldName) {
JsonNode typeNode = node.get(fieldName);
long date = typeNode == null ? -1 : typeNode.asLong(-1);
if (date==-1) {
if (date == -1) {
return null;
} else {
return new Date(date);
}
}

public static Map<String,Object> getNodeAsMap(JsonNode node) {
public static Map<String, Object> getNodeAsMap(JsonNode node) {
return objectMapper.convertValue(node, Map.class);
}

public static boolean hasLength(CharSequence str) {
return !(str == null || str.length()==0);
return !(str == null || str.length() == 0);
}

public static boolean hasText(CharSequence str) {
Expand Down
Loading
Loading