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

[Draft] Introducing the capability to configure push notification providers #287

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.central.log.mgt</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.event.handler.notification</groupId>
<artifactId>org.wso2.carbon.identity.notification.sender.tenant.config</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.notification.push</groupId>
<artifactId>org.wso2.carbon.identity.notification.push.provider</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand Down Expand Up @@ -181,6 +189,7 @@
org.wso2.carbon.identity.base; version="${carbon.identity.framework.imp.pkg.version.range}",
org.wso2.carbon.identity.event; version="${carbon.identity.framework.imp.pkg.version.range}",
org.wso2.carbon.identity.event.event; version="${carbon.identity.framework.imp.pkg.version.range}",
org.wso2.carbon.identity.event.bean; version="${carbon.identity.framework.imp.pkg.version.range}",
org.wso2.carbon.identity.event.handler; version="${carbon.identity.framework.imp.pkg.version.range}",
org.wso2.carbon.identity.application.authentication.framework.config; version="${carbon.identity.framework.imp.pkg.version.range}",
org.wso2.carbon.identity.application.mgt;version="${carbon.identity.framework.imp.pkg.version.range}",
Expand All @@ -196,6 +205,12 @@
org.wso2.carbon.identity.organization.management.service;version="${org.wso2.identity.organization.mgt.core.imp.pkg.version.range}",
org.wso2.carbon.identity.organization.management.service.constant;version="${org.wso2.identity.organization.mgt.core.imp.pkg.version.range}",
org.wso2.carbon.identity.organization.management.service.exception;version="${org.wso2.identity.organization.mgt.core.imp.pkg.version.range}",
org.wso2.carbon.identity.notification.push.provider; version="${identity.notification.push.version.range}",
org.wso2.carbon.identity.notification.push.provider.exception; version="${identity.notification.push.version.range}",
org.wso2.carbon.identity.notification.push.provider.model; version="${identity.notification.push.version.range}",
org.wso2.carbon.identity.notification.sender.tenant.config; version="${identity.event.handler.notification.imp.pkg.version.range}",
org.wso2.carbon.identity.notification.sender.tenant.config.dto; version="${identity.event.handler.notification.imp.pkg.version.range}",
org.wso2.carbon.identity.notification.sender.tenant.config.exception; version="${identity.event.handler.notification.imp.pkg.version.range}",
</Import-Package>
</instructions>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,79 @@ public static class SMSNotification {
public static final String DEFAULT_SMS_NOTIFICATION_LOCALE = "en_US";
}

public static class PushNotification {

public static final String PUSH_NOTIFICATION_EVENT = "TRIGGER_PUSH_NOTIFICATION";
public static final String PUSH_NOTIFICATION_HANDLER_NAME = "PushNotificationHandler";
public static final String PUSH_PUBLISHER_NAME = "PushPublisher";
public static final String PUSH_AUTHENTICATION_SCENARIO = "AUTHENTICATION";

public static final String NOTIFICATION_SCENARIO = "NOTIFICATION_SCENARIO";
public static final String NOTIFICATION_PROVIDER = "notificationProvider";
public static final String PUSH_ID = "pushId";
public static final String DEVICE_TOKEN = "deviceToken";
public static final String CHALLENGE = "challenge";
public static final String NUMBER_CHALLENGE = "numberChallenge";
public static final String IP_ADDRESS = "ipAddress";
public static final String REQUEST_DEVICE_OS = "deviceOS";
public static final String REQUEST_DEVICE_BROWSER = "browser";
}

public enum PushNotificationTemplate {

AUTHENTICATION(
PushNotification.PUSH_AUTHENTICATION_SCENARIO,
"Authentication Request",
"{{user-name}} from {{organization-name}} is trying to login");

private String scenario;
private String title;
private String body;

PushNotificationTemplate(String scenario, String title, String body) {

this.scenario = scenario;
this.title = title;
this.body = body;
}

public String getScenario() {

return scenario;
}

public String getTitle() {

return title;
}

public String getBody() {

return body;
}
}

public enum PushNotificationPlaceholder {

USER_NAME("user-name"),
USER_GIVEN_NAME("user.claim.givenname"),
USER_STORE_DOMAIN("userstore-domain"),
ORGANIZATION_NAME("organization-name"),
TENANT_DOMAIN("tenant-domain"),;

private String placeholder;

PushNotificationPlaceholder(String placeholder) {

this.placeholder = placeholder;
}

public String getPlaceholder() {

return placeholder;
}
}

/**
* Define logging constants.
*/
Expand Down
Loading
Loading