Skip to content
Snippets Groups Projects
Commit 33342fb8 authored by Oleksandr Kosse (EPAM)'s avatar Oleksandr Kosse (EPAM)
Browse files

Merge branch 'GONRG-5228-check-dockerignore' into 'master'

GONRG-5228: Added .dockerignore and .gitattributes

See merge request !226
parents e6d03678 6dcf7149
No related branches found
No related tags found
2 merge requests!232Update os-core-lib-azure,!226GONRG-5228: Added .dockerignore and .gitattributes
Pipeline #120775 failed
Showing
with 342 additions and 384 deletions
**/*.md
**/*.yml
**/*.yaml
**/Dockerfile*
.*
* text=auto eol=lf
{{- if .Values.conf.on_prem_enabled }} {{- if .Values.conf.on_prem_enabled }}
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: "{{ .Values.data.serviceAccountName }}" name: "{{ .Values.data.serviceAccountName }}"
namespace: "{{ .Release.Namespace }}" namespace: "{{ .Release.Namespace }}"
{{- end }} {{- end }}
...@@ -28,4 +28,4 @@ COPY /provider/notification-aws/build-aws/ssl.sh /ssl.sh ...@@ -28,4 +28,4 @@ COPY /provider/notification-aws/build-aws/ssl.sh /ssl.sh
COPY /provider/notification-aws/build-aws/entrypoint.sh /entrypoint.sh COPY /provider/notification-aws/build-aws/entrypoint.sh /entrypoint.sh
EXPOSE 8080 EXPOSE 8080
ENTRYPOINT ["/bin/sh", "-c", ". /entrypoint.sh"] ENTRYPOINT ["/bin/sh", "-c", ". /entrypoint.sh"]
\ No newline at end of file
#
# Copyright 2017-2020, Schlumberger
#
# 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.
#
FROM openjdk:8-slim
RUN apt-get update && apt-get install -y curl
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
EXPOSE 8080
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
#
# Copyright 2017-2020, Schlumberger
#
# 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.
#
version: "3"
services:
os-notification-app:
build:
args:
JAR_FILE: target/notification-gcp-1.0.0-spring-boot.jar
context: ..
dockerfile: docker/Dockerfile
image: gcr.io/opendes/os-notification-app
ports:
- "8080:8080"
# Service Configuration for Anthos # Service Configuration for Anthos
## Table of Contents <a name="TOC"></a> ## Table of Contents <a name="TOC"></a>
* [Environment variables](#Environment-variables)
* [Common properties for all environments](#Common-properties-for-all-environments) * [Service Configuration for Anthos](#service-configuration-for-anthos)
* [For Mappers to activate drivers](#For-Mappers-to-activate-drivers) * [Table of Contents <a name="TOC"></a>](#table-of-contents-)
* [Requirements for requests](#Requirements-for-requests) * [Environment variables](#environment-variables)
* [Configuring mappers Datasources](#Configuring-mappers-Datasources) * [Common properties for all environments](#common-properties-for-all-environments)
* [For OQM RabbitMQ](#For-OQM-RabbitMQ) * [For Mappers to activate drivers](#for-mappers-to-activate-drivers)
* [Exchanges and queues configuration](#Exchanges-and-queues-configuration) * [Requirements for requests](#requirements-for-requests)
* [Interaction with message brokers](#Interaction-with-message-brokers) * [Configuring mappers Datasources](#configuring-mappers-datasources)
* [Keycloak configuration](#Keycloak-configuration) * [For OQM RabbitMQ](#for-oqm-rabbitmq)
* [Exchanges and queues configuration](#exchanges-and-queues-configuration)
* [Interaction with message brokers](#interaction-with-message-brokers)
* [Specifics of work through PULL subscription](#specifics-of-work-through-pull-subscription)
* [Keycloak configuration](#keycloak-configuration)
## Environment variables ## Environment variables
...@@ -45,7 +49,7 @@ Record identifiers cannot contain a space character. At the same time, they may ...@@ -45,7 +49,7 @@ Record identifiers cannot contain a space character. At the same time, they may
combined with subsequent numeric characters, may cause the application to misinterpret that combination. For example, combined with subsequent numeric characters, may cause the application to misinterpret that combination. For example,
the "%20" combination will be interpreted as a space " " character. To correctly transfer such an identifier, you should the "%20" combination will be interpreted as a space " " character. To correctly transfer such an identifier, you should
additionally perform the url-encode operation on it. This functionality can be built into the front-end application, or additionally perform the url-encode operation on it. This functionality can be built into the front-end application, or
you can use an online url-encoder tool ( eg.: https://www.urlencoder.org/). Thus, having ID "osdu: you can use an online url-encoder tool ( eg.: <https://www.urlencoder.org/>). Thus, having ID "osdu:
work-product-component--WellboreMarkerSet:3D%20Kirchhoff%20DepthMigration" (with %20 combination) work-product-component--WellboreMarkerSet:3D%20Kirchhoff%20DepthMigration" (with %20 combination)
you should url-encode it and request you should url-encode it and request
"osdu%3Awork-product-component--WellboreMarkerSet%3A3D%2520Kirchhoff%2520DepthMigration" instead. "osdu%3Awork-product-component--WellboreMarkerSet%3A3D%2520Kirchhoff%2520DepthMigration" instead.
...@@ -60,8 +64,8 @@ PartitionInfo for each Tenant. ...@@ -60,8 +64,8 @@ PartitionInfo for each Tenant.
**prefix:** `oqm.rabbitmq` **prefix:** `oqm.rabbitmq`
It can be overridden by: It can be overridden by:
- through the Spring Boot property `oqm.rabbitmq.partition-properties-prefix` * through the Spring Boot property `oqm.rabbitmq.partition-properties-prefix`
- environment variable `OQM_RABBITMQ_PARTITION_PROPERTIES_PREFIX`` * environment variable `OQM_RABBITMQ_PARTITION_PROPERTIES_PREFIX``
**Propertyset** (for two types of connection: messaging and admin operations): **Propertyset** (for two types of connection: messaging and admin operations):
...@@ -145,8 +149,8 @@ At RabbitMq should be created exchange with name: ...@@ -145,8 +149,8 @@ At RabbitMq should be created exchange with name:
It can be overridden by: It can be overridden by:
- through the Spring Boot property `oqm-register-subscriber-control-topic-name` * through the Spring Boot property `oqm-register-subscriber-control-topic-name`
- environment variable `OQM_REGISTER_SUBSCRIBER_CONTROL_TOPIC_NAME` * environment variable `OQM_REGISTER_SUBSCRIBER_CONTROL_TOPIC_NAME`
![Screenshot](./pics/rabbit.PNG) ![Screenshot](./pics/rabbit.PNG)
...@@ -175,4 +179,4 @@ Each Client has embedded Service Account (SA) option. Enable SAs for Clients, ma ...@@ -175,4 +179,4 @@ Each Client has embedded Service Account (SA) option. Enable SAs for Clients, ma
Add `partition-and-entitlements` scope to `Default Client Scopes` and generate Keys. Add `partition-and-entitlements` scope to `Default Client Scopes` and generate Keys.
Give `client-id` and `client-secret` to services, which should be authorized within the platform. Give `client-id` and `client-secret` to services, which should be authorized within the platform.
\ No newline at end of file
/* Licensed Materials - Property of IBM */ /* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/ /* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.notification.provider.ibm; package org.opengroup.osdu.notification.provider.ibm;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication @SpringBootApplication
@ComponentScan({"org.opengroup.osdu"}) @ComponentScan({"org.opengroup.osdu"})
@EnableAsync @EnableAsync
public class Application { public class Application {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(new Class[] { Application.class} , args); SpringApplication.run(new Class[] { Application.class} , args);
} }
} }
/* Licensed Materials - Property of IBM */ /* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/ /* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.notification.provider.ibm.di; package org.opengroup.osdu.notification.provider.ibm.di;
import org.opengroup.osdu.core.common.util.IServiceAccountJwtClient; import org.opengroup.osdu.core.common.util.IServiceAccountJwtClient;
import org.opengroup.osdu.notification.provider.ibm.util.AppProperties; import org.opengroup.osdu.notification.provider.ibm.util.AppProperties;
import org.opengroup.osdu.notification.provider.ibm.util.ServiceAccountJwtIBMClientImpl; import org.opengroup.osdu.notification.provider.ibm.util.ServiceAccountJwtIBMClientImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AbstractFactoryBean; import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
public class ServiceAccountJwtClientFactory extends AbstractFactoryBean<IServiceAccountJwtClient> { public class ServiceAccountJwtClientFactory extends AbstractFactoryBean<IServiceAccountJwtClient> {
@Override @Override
public IServiceAccountJwtClient createInstance() throws Exception { public IServiceAccountJwtClient createInstance() throws Exception {
return new ServiceAccountJwtIBMClientImpl(); return new ServiceAccountJwtIBMClientImpl();
} }
@Override @Override
public Class<?> getObjectType() { public Class<?> getObjectType() {
return IServiceAccountJwtClient.class; return IServiceAccountJwtClient.class;
} }
} }
/* Licensed Materials - Property of IBM */ /* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/ /* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.notification.provider.ibm.util; package org.opengroup.osdu.notification.provider.ibm.util;
import org.opengroup.osdu.notification.provider.interfaces.IAppProperties; import org.opengroup.osdu.notification.provider.interfaces.IAppProperties;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@Component @Component
public class AppProperties implements IAppProperties { public class AppProperties implements IAppProperties {
@Value("${app.entitlements}") @Value("${app.entitlements}")
private String authorizeAPI; private String authorizeAPI;
@Value("${app.register}") @Value("${app.register}")
private String registerAPI; private String registerAPI;
@Value("${app.expireTime}") @Value("${app.expireTime}")
private int expireTime; private int expireTime;
@Value("${app.maxCacheSize}") @Value("${app.maxCacheSize}")
private int maxCacheSize; private int maxCacheSize;
public String getAuthorizeAPI() { public String getAuthorizeAPI() {
return authorizeAPI; return authorizeAPI;
} }
public String getRegisterAPI() { public String getRegisterAPI() {
return registerAPI; return registerAPI;
} }
} }
/* Licensed Materials - Property of IBM */ /* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/ /* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.notification.provider.ibm.util; package org.opengroup.osdu.notification.provider.ibm.util;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
//import org.opengroup.osdu.core.gcp.GoogleIdToken.IGoogleIdTokenFactory; //import org.opengroup.osdu.core.gcp.GoogleIdToken.IGoogleIdTokenFactory;
import org.opengroup.osdu.notification.provider.interfaces.IGoogleServiceAccount; import org.opengroup.osdu.notification.provider.interfaces.IGoogleServiceAccount;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import lombok.SneakyThrows; import lombok.SneakyThrows;
@Component @Component
public class GoogleServiceAccountImpl implements IGoogleServiceAccount { public class GoogleServiceAccountImpl implements IGoogleServiceAccount {
@SneakyThrows @SneakyThrows
@Override @Override
public String getIdToken(String keyString, String audience) { public String getIdToken(String keyString, String audience) {
// TODO for GSA token validation check whether we have to impl // TODO for GSA token validation check whether we have to impl
return "token";//this.googleIdTokenFactory.getGoogleIdToken(keyString, audience, this.closeableHttpClient); return "token";//this.googleIdTokenFactory.getGoogleIdToken(keyString, audience, this.closeableHttpClient);
} }
} }
\ No newline at end of file
/* Licensed Materials - Property of IBM */ /* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/ /* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.notification.provider.ibm.util; package org.opengroup.osdu.notification.provider.ibm.util;
import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken; import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken;
import com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier; import com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier;
import com.google.api.client.http.javanet.NetHttpTransport; import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.client.json.jackson2.JacksonFactory;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.notification.provider.interfaces.IServiceAccountValidator; import org.opengroup.osdu.notification.provider.interfaces.IServiceAccountValidator;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
public class IBMServiceAccountValidatorImpl implements IServiceAccountValidator { public class IBMServiceAccountValidatorImpl implements IServiceAccountValidator {
@Override @Override
public boolean isValidPublisherServiceAccount(String jwt) { public boolean isValidPublisherServiceAccount(String jwt) {
//call isValidServiceAccount() //call isValidServiceAccount()
// Check whether IBM have to implement the service account verification for PubSub Role // Check whether IBM have to implement the service account verification for PubSub Role
// Marking it to return true, for the integration tests. // Marking it to return true, for the integration tests.
return false; return false;
} }
@Override @Override
public boolean isValidServiceAccount(String jwt, String userIdentity, String... googleAudiences) { public boolean isValidServiceAccount(String jwt, String userIdentity, String... googleAudiences) {
// Marking it to return true, for the integration tests. // Marking it to return true, for the integration tests.
return true; return true;
} }
} }
/* Licensed Materials - Property of IBM */ /* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/ /* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.notification.provider.ibm.util; package org.opengroup.osdu.notification.provider.ibm.util;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
public class JwtValidity { public class JwtValidity {
String token; String token;
long expiryTime; long expiryTime;
JwtValidity(String jwt, long expiryTime) { JwtValidity(String jwt, long expiryTime) {
this.token = jwt; this.token = jwt;
this.expiryTime = expiryTime; this.expiryTime = expiryTime;
} }
} }
/* Licensed Materials - Property of IBM */ /* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/ /* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.notification.provider.ibm.util; package org.opengroup.osdu.notification.provider.ibm.util;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.HttpsURLConnection;
import org.apache.http.HttpStatus; import org.apache.http.HttpStatus;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException; import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.util.IServiceAccountJwtClient; import org.opengroup.osdu.core.common.util.IServiceAccountJwtClient;
import org.opengroup.osdu.core.ibm.util.KeyCloakProvider; import org.opengroup.osdu.core.ibm.util.KeyCloakProvider;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
@Component @Component
public class ServiceAccountJwtIBMClientImpl implements IServiceAccountJwtClient { public class ServiceAccountJwtIBMClientImpl implements IServiceAccountJwtClient {
//private AppProperties config; //private AppProperties config;
/*@Autowired /*@Autowired
JaxRsDpsLog log;*/ JaxRsDpsLog log;*/
@Value("${keycloak.url}") @Value("${keycloak.url}")
private String url; private String url;
@Value("${keycloak.realm}") @Value("${keycloak.realm}")
private String realm; private String realm;
@Value("${keycloak.client_id}") @Value("${keycloak.client_id}")
private String client_id; private String client_id;
@Value("${keycloak.client_secert}") @Value("${keycloak.client_secert}")
private String client_secret; private String client_secret;
private String grant_type = "password"; private String grant_type = "password";
@Value("${keycloak.user}") @Value("${keycloak.user}")
private String user; private String user;
@Value("${keycloak.password}") @Value("${keycloak.password}")
private String pwd; private String pwd;
/* public ServiceAccountJwtIBMClientImpl(AppProperties config) { /* public ServiceAccountJwtIBMClientImpl(AppProperties config) {
if (config == null) { if (config == null) {
throw new IllegalArgumentException("AppProperties is null when initializing jwt client."); throw new IllegalArgumentException("AppProperties is null when initializing jwt client.");
} else { } else {
this.config = config; this.config = config;
} }
}*/ }*/
@Override @Override
public String getIdToken(String tenantName) { public String getIdToken(String tenantName) {
/* String t1=null; /* String t1=null;
try { try {
t1=KeyCloakProvider.getToken(user, pwd); t1=KeyCloakProvider.getToken(user, pwd);
System.out.println("************t1 "+t1); System.out.println("************t1 "+t1);
return "Bearer "+t1; return "Bearer "+t1;
} catch (IOException e1) { } catch (IOException e1) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e1.printStackTrace(); e1.printStackTrace();
}*/ }*/
String token_endpoint = String.format("https://%s/auth/realms/%s/protocol/openid-connect/token", url, realm); String token_endpoint = String.format("https://%s/auth/realms/%s/protocol/openid-connect/token", url, realm);
URL url; URL url;
String token = null; String token = null;
HttpsURLConnection con; HttpsURLConnection con;
try { try {
url = new URL(token_endpoint); url = new URL(token_endpoint);
con = (HttpsURLConnection) url.openConnection(); con = (HttpsURLConnection) url.openConnection();
con.setRequestMethod("POST"); con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
Map<String, String> parameters = new HashMap<>(); Map<String, String> parameters = new HashMap<>();
parameters.put("grant_type", grant_type); parameters.put("grant_type", grant_type);
parameters.put("client_id", client_id); parameters.put("client_id", client_id);
parameters.put("client_secret", client_secret); parameters.put("client_secret", client_secret);
parameters.put("username", user); parameters.put("username", user);
parameters.put("password", pwd); parameters.put("password", pwd);
con.setDoOutput(true); con.setDoOutput(true);
DataOutputStream out = new DataOutputStream(con.getOutputStream()); DataOutputStream out = new DataOutputStream(con.getOutputStream());
out.writeBytes(getParamsString(parameters)); out.writeBytes(getParamsString(parameters));
out.flush(); out.flush();
out.close(); out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine; String inputLine;
StringBuffer content = new StringBuffer(); StringBuffer content = new StringBuffer();
while ((inputLine = in.readLine()) != null) { while ((inputLine = in.readLine()) != null) {
content.append(inputLine); content.append(inputLine);
} }
in.close(); in.close();
con.disconnect(); con.disconnect();
Gson gson = new Gson(); Gson gson = new Gson();
JsonObject jobj = gson.fromJson(content.toString(), JsonObject.class); JsonObject jobj = gson.fromJson(content.toString(), JsonObject.class);
token = jobj.get("access_token").getAsString(); token = jobj.get("access_token").getAsString();
token = "Bearer "+token; token = "Bearer "+token;
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
log.error("MalformedURLException while generating token"+e.getMessage()); log.error("MalformedURLException while generating token"+e.getMessage());
e.printStackTrace(); e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {
log.error("IOException while generating token"+e.getMessage()); log.error("IOException while generating token"+e.getMessage());
throw new AppException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "Provided invalid details", "Error generating token"); throw new AppException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "Provided invalid details", "Error generating token");
} }
return token; return token;
// TODO : Implement jwtCache for storing generated token // TODO : Implement jwtCache for storing generated token
} }
private static String getParamsString(Map<String, String> params) private static String getParamsString(Map<String, String> params)
throws UnsupportedEncodingException { throws UnsupportedEncodingException {
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
for (Map.Entry<String, String> entry : params.entrySet()) { for (Map.Entry<String, String> entry : params.entrySet()) {
result.append(URLEncoder.encode(entry.getKey(), "UTF-8")); result.append(URLEncoder.encode(entry.getKey(), "UTF-8"));
result.append("="); result.append("=");
result.append(URLEncoder.encode(entry.getValue(), "UTF-8")); result.append(URLEncoder.encode(entry.getValue(), "UTF-8"));
result.append("&"); result.append("&");
} }
String resultString = result.toString(); String resultString = result.toString();
return resultString.length() > 0 return resultString.length() > 0
? resultString.substring(0, resultString.length() - 1) ? resultString.substring(0, resultString.length() - 1)
: resultString; : resultString;
} }
} }
LOG_PREFIX=notification LOG_PREFIX=notification
server.servlet.contextPath=/ server.servlet.contextPath=/
app.expireTime=300 app.expireTime=300
app.maxCacheSize=10 app.maxCacheSize=10
server.error.whitelabel.enabled=false server.error.whitelabel.enabled=false
keycloak.url=TODO keycloak.url=TODO
keycloak.realm=TODO keycloak.realm=TODO
keycloak.client_id=TODO keycloak.client_id=TODO
keycloak.client_secert=TODO keycloak.client_secert=TODO
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment