Skip to content

Commit 8bc5334

Browse files
Tanishka JainTanishka Jain
authored andcommitted
Added sns implementation for sending notification regarding saml authenticated user data changes
1 parent e8c0e12 commit 8bc5334

File tree

18 files changed

+454
-129
lines changed

18 files changed

+454
-129
lines changed

Jenkinsfile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ pipeline
5858
}
5959
dir('uaa/iam-k8s-utils') {
6060
git changelog: false, credentialsId: 'github.software.gevernova.com', poll: false,
61-
url: 'https://github.software.gevernova.com/pers/iam-k8s-utils.git'
61+
url: 'https://github.software.gevernova.com/pers/iam-k8s-utils.git',
62+
branch: 'aws-sdk-for-sns-sqs'
6263
}
6364
sh '''#!/bin/bash -ex
6465
source uaa-cf-release/config-local/set-env.sh
@@ -110,7 +111,8 @@ pipeline
110111
}
111112
dir('uaa/iam-k8s-utils') {
112113
git changelog: false, credentialsId: 'github.software.gevernova.com', poll: false,
113-
url: 'https://github.software.gevernova.com/pers/iam-k8s-utils.git'
114+
url: 'https://github.software.gevernova.com/pers/iam-k8s-utils.git',
115+
branch: 'aws-sdk-for-sns-sqs'
114116
}
115117
sh '''#!/bin/bash -ex
116118
source uaa-cf-release/config-local/set-env.sh
@@ -186,7 +188,8 @@ pipeline
186188
}
187189
dir('uaa/iam-k8s-utils') {
188190
git changelog: false, credentialsId: 'github.software.gevernova.com', poll: false,
189-
url: 'https://github.software.gevernova.com/pers/iam-k8s-utils.git'
191+
url: 'https://github.software.gevernova.com/pers/iam-k8s-utils.git',
192+
branch: 'aws-sdk-for-sns-sqs'
190193
}
191194
sh '''#!/bin/bash -ex
192195
source uaa-cf-release/config-local/set-env.sh
@@ -256,7 +259,8 @@ pipeline
256259
}
257260
dir('uaa/iam-k8s-utils') {
258261
git changelog: false, credentialsId: 'github.software.gevernova.com', poll: false,
259-
url: 'https://github.software.gevernova.com/pers/iam-k8s-utils.git'
262+
url: 'https://github.software.gevernova.com/pers/iam-k8s-utils.git',
263+
branch: 'aws-sdk-for-sns-sqs'
260264
}
261265

262266
sh '''#!/bin/bash -ex
@@ -477,7 +481,8 @@ pipeline
477481
}
478482
dir('uaa/iam-k8s-utils') {
479483
git changelog: false, credentialsId: 'github.software.gevernova.com', poll: false,
480-
url: 'https://github.software.gevernova.com/pers/iam-k8s-utils.git'
484+
url: 'https://github.software.gevernova.com/pers/iam-k8s-utils.git',
485+
branch: 'aws-sdk-for-sns-sqs'
481486
}
482487
dir('uaa-k8s-deploy') {
483488
git changelog: false, credentialsId: 'github.software.gevernova.com', poll: false,
@@ -622,6 +627,7 @@ pipeline
622627
dir('uaa/iam-k8s-utils') {
623628
git changelog: false, credentialsId: 'github.software.gevernova.com', poll: false,
624629
url: 'https://github.software.gevernova.com/pers/iam-k8s-utils.git'
630+
branch: 'aws-sdk-for-sns-sqs'
625631
}
626632
withSonarQubeEnv('SONAR_INSTANCE') {
627633
sh """

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,3 +454,7 @@ task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
454454
}
455455
dependsOn subprojects.test
456456
}
457+
458+
tasks.withType(Test).configureEach {
459+
systemProperty 'deployment.region', project.findProperty('deployment.region') ?: 'us-west-2'
460+
}

dependencies.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ versions.tomcatCargoVersion = "9.0.60"
2121
versions.guavaVersion = "31.1-jre"
2222
versions.springCloud = "2.0.9.RELEASE"
2323
versions.jakartaElVersion = "3.0.4"
24+
versions.awsSdkVersion = "2.18.0"
2425

2526
// Dependencies (some rely on shared versions, some are shared between projects)
2627
libraries.apacheCommonsRngCore = "org.apache.commons:commons-rng-core:1.4"

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ version=75.18.1
44
org.gradle.jvmargs=-Dfile.encoding=utf8 -XX:+StartAttachListener -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/uaa-tests.hprof
55
org.gradle.workers.max=6
66

7+
deployment.region=us-west-2
8+
79
org.gradle.parallel=true
810

911
signing.keyId=

k8s/templates/uaa.lib.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
---
66
issuer:
77
uri: #@ data.values.issuer.uri
8+
deployment:
9+
region: 'us-west-2'
810

911
#! The secret that an external login server will use to authenticate to the uaa using the id `login`
1012
LOGIN_SECRET: loginsecret

k8s/templates/values/_values.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ resources:
2727

2828
issuer:
2929
uri: http://localhost:8080/uaa
30+
deployment:
31+
region: us-west-2
3032

3133
tomcat:
3234
accessLoggingEnabled: "y"

server/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description = "CloudFoundry Identity Server JAR"
55
dependencies {
66
implementation(project(":cloudfoundry-identity-metrics-data"))
77
implementation(project(":cloudfoundry-identity-model"))
8+
implementation(project(":iam-k8s-utils")) // Added dependency to iam-k8s-utils module
89

910
implementation(libraries.tomcatJdbc)
1011
providedCompile(libraries.tomcatEmbed)

server/src/main/java/org/cloudfoundry/identity/uaa/authentication/event/UserLoginSuccessEvent.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

server/src/main/java/org/cloudfoundry/identity/uaa/authentication/listener/UserLoginSuccessEventListener.java

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package org.cloudfoundry.identity.uaa.events;
2+
3+
import org.cloudfoundry.identity.uaa.user.UaaUser;
4+
import org.springframework.context.ApplicationEvent;
5+
6+
/**
7+
* Event published when user attributes change
8+
* This event is processed asynchronously to publish SNS notifications
9+
*/
10+
public class UserAttributeChangedEvent extends ApplicationEvent {
11+
12+
private final UaaUser existingUser;
13+
private final UaaUser updatedUser;
14+
15+
public UserAttributeChangedEvent(Object source, UaaUser existingUser, UaaUser updatedUser) {
16+
super(source);
17+
this.existingUser = existingUser;
18+
this.updatedUser = updatedUser;
19+
}
20+
21+
public UaaUser getExistingUser() {
22+
return existingUser;
23+
}
24+
25+
public UaaUser getUpdatedUser() {
26+
return updatedUser;
27+
}
28+
29+
@Override
30+
public String toString() {
31+
return "UserAttributeChangedEvent{" +
32+
"userId=" + (updatedUser != null ? updatedUser.getId() : "null") +
33+
'}';
34+
}
35+
}

0 commit comments

Comments
 (0)