From 3f6e2e4600032598222e889f0c95f85225bb7d2c Mon Sep 17 00:00:00 2001 From: ashutoshkumar Date: Mon, 29 Jan 2024 13:24:00 +0530 Subject: [PATCH 1/3] log redaction --- CHANGELOG.md | 5 +++++ README.md | 4 ++-- pom.properties | 2 +- pom.xml | 2 +- src/main/java/com/plivo/api/models/message/Message.java | 5 +++++ .../java/com/plivo/api/models/message/MessageCreator.java | 6 +++--- src/main/resources/com/plivo/api/version.txt | 2 +- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bbee7d5..1154b2b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## [5.38.2](https://github.com/plivo/plivo-java/tree/v5.38.2) (2024-01-29) +**Feature - Log Redaction Enhancement** +- Added log attribute in GET and List MDR response +- Change log field from bool to string in send SMS + ## [5.38.1](https://github.com/plivo/plivo-java/tree/v5.38.1) (2023-12-19) **Feature - Added params for Speak API** - Added params 'type' for Speak APIs diff --git a/README.md b/README.md index 9003b71c..ffed0094 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,13 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe com.plivo plivo-java - 5.38.1 + 5.38.2 ``` If you are using Gradle, use the following line in your dependencies. ``` -compile 'com.plivo:plivo-java:5.38.0' +compile 'com.plivo:plivo-java:5.38.2' ``` ### To Install Beta release diff --git a/pom.properties b/pom.properties index eaa4abb0..ef234359 100644 --- a/pom.properties +++ b/pom.properties @@ -1,6 +1,6 @@ # Written manually. -version=5.38.1 +version=5.38.2 groupId=com.plivo artifactId=plivo-java diff --git a/pom.xml b/pom.xml index 6e29d472..a7a48a76 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.plivo plivo-java - 5.38.1 + 5.38.2 plivo-java A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML diff --git a/src/main/java/com/plivo/api/models/message/Message.java b/src/main/java/com/plivo/api/models/message/Message.java index 801b88f1..27d572a7 100644 --- a/src/main/java/com/plivo/api/models/message/Message.java +++ b/src/main/java/com/plivo/api/models/message/Message.java @@ -33,6 +33,7 @@ public class Message extends BaseResource { private String conversationID; private String conversationOrigin; private String conversationExpirationTimestamp; + private String log; public static MessageCreator creator(String source, String destination) { return new MessageCreator(source, destination); @@ -174,6 +175,10 @@ public String getConversationOrigin() { public String getConversationExpirationTimestamp() { return conversationExpirationTimestamp; } + + public String getLog() { + return log; + } @Override public String getId() { diff --git a/src/main/java/com/plivo/api/models/message/MessageCreator.java b/src/main/java/com/plivo/api/models/message/MessageCreator.java index bba863a1..77e11729 100644 --- a/src/main/java/com/plivo/api/models/message/MessageCreator.java +++ b/src/main/java/com/plivo/api/models/message/MessageCreator.java @@ -27,7 +27,7 @@ public class MessageCreator extends Creator < MessageCreateResponse > { private MessageType type = null; private URL url = null; private String method = "POST"; - private Boolean log = null; + private String log = "true"; private Boolean trackable = null; private String[] media_urls = null; private String[] media_ids = null; @@ -135,7 +135,7 @@ public String method() { return this.method; } - public Boolean log() { + public String log() { return this.log; } @@ -191,7 +191,7 @@ public MessageCreator method(final String method) { * @param log If set to false, the content of this message will not be logged on the Plivo * infrastructure and the dst value will be masked */ - public MessageCreator log(final Boolean log) { + public MessageCreator log(final String log) { this.log = log; return this; } diff --git a/src/main/resources/com/plivo/api/version.txt b/src/main/resources/com/plivo/api/version.txt index bd4c0e53..377c661f 100644 --- a/src/main/resources/com/plivo/api/version.txt +++ b/src/main/resources/com/plivo/api/version.txt @@ -1 +1 @@ -5.38.1 \ No newline at end of file +5.38.2 \ No newline at end of file From 01b48796bfcc1cac6edf8db64d405bab66ea3a17 Mon Sep 17 00:00:00 2001 From: ashutoshkumar Date: Thu, 22 Feb 2024 11:21:37 +0530 Subject: [PATCH 2/3] data-type conversion for log field --- .../com/plivo/api/models/message/MessageCreator.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/plivo/api/models/message/MessageCreator.java b/src/main/java/com/plivo/api/models/message/MessageCreator.java index 77e11729..76c265ea 100644 --- a/src/main/java/com/plivo/api/models/message/MessageCreator.java +++ b/src/main/java/com/plivo/api/models/message/MessageCreator.java @@ -191,8 +191,14 @@ public MessageCreator method(final String method) { * @param log If set to false, the content of this message will not be logged on the Plivo * infrastructure and the dst value will be masked */ - public MessageCreator log(final String log) { - this.log = log; + public MessageCreator log(final Object log) { + if (log instanceof Boolean) { + this.log = ((Boolean) log).toString(); + } else if (log instanceof String) { + this.log = (String) log; + } else { + throw new IllegalArgumentException("Invalid log value. Expected boolean or string."); + } return this; } From 8fe98ccbb02dd735a22ea7c13f9467728ccfecd3 Mon Sep 17 00:00:00 2001 From: ashutoshkumar Date: Wed, 28 Feb 2024 16:35:56 +0530 Subject: [PATCH 3/3] fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b16da769..414efb78 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe If you are using Gradle, use the following line in your dependencies. ``` -compile 'com.plivo:plivo-java:5.38.2' +compile 'com.plivo:plivo-java:5.38.3' ``` ### To Install Beta release