From 0d240a68acaeea86c3a477e7cfaa78c3f752ba00 Mon Sep 17 00:00:00 2001 From: Krishanx92 Date: Tue, 3 Oct 2023 14:03:36 +0530 Subject: [PATCH] Update file list --- .../ballerina/Ballerina.toml | 2 +- .../ballerina/Ballerina.toml.template | 2 +- .../ballerina/Dependencies.toml | 73 ++++++++++-------- .../ballerina/Dependencies.toml.template | 73 ++++++++++-------- .../ballerina/admin-api_service.bal | 6 +- admin/admin-domain-service/ballerina/init.bal | 6 +- .../ballerina/internal-admin-api_service.bal | 7 +- .../ballerina/Ballerina.toml | 2 +- .../ballerina/Ballerina.toml.template | 2 +- .../ballerina/Dependencies.toml | 72 +++++++++--------- .../ballerina/Dependencies.toml.template | 74 ++++++++++--------- .../ballerina/backoffice-api_service.bal | 8 +- .../backoffice-internal-api_service.bal | 9 ++- .../ballerina/init.bal | 2 +- .../ballerina/types.bal | 2 +- 15 files changed, 196 insertions(+), 144 deletions(-) diff --git a/admin/admin-domain-service/ballerina/Ballerina.toml b/admin/admin-domain-service/ballerina/Ballerina.toml index 2b24ed80c..d349336d7 100644 --- a/admin/admin-domain-service/ballerina/Ballerina.toml +++ b/admin/admin-domain-service/ballerina/Ballerina.toml @@ -2,7 +2,7 @@ org = "wso2" name = "admin_service" version = "0.0.1-SNAPSHOT" -distribution = "2201.5.0" +distribution = "2201.8.0" [[dependency]] org = "wso2" diff --git a/admin/admin-domain-service/ballerina/Ballerina.toml.template b/admin/admin-domain-service/ballerina/Ballerina.toml.template index 09e2f9089..b89c6c980 100644 --- a/admin/admin-domain-service/ballerina/Ballerina.toml.template +++ b/admin/admin-domain-service/ballerina/Ballerina.toml.template @@ -2,7 +2,7 @@ org = "wso2" name = "admin_service" version = "PROJECT_VERSION" -distribution = "2201.5.0" +distribution = "2201.8.0" [[dependency]] org = "wso2" diff --git a/admin/admin-domain-service/ballerina/Dependencies.toml b/admin/admin-domain-service/ballerina/Dependencies.toml index d686bb6c0..61172bffc 100644 --- a/admin/admin-domain-service/ballerina/Dependencies.toml +++ b/admin/admin-domain-service/ballerina/Dependencies.toml @@ -5,25 +5,24 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.5.0" +distribution-version = "2201.8.0" [[package]] org = "ballerina" name = "auth" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.array"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "regex"} + {org = "ballerina", name = "log"} ] [[package]] org = "ballerina" name = "cache" -version = "3.4.0" +version = "3.7.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -34,7 +33,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.1.0" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -45,7 +44,7 @@ modules = [ [[package]] org = "ballerina" name = "crypto" -version = "2.3.0" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -54,20 +53,18 @@ dependencies = [ [[package]] org = "ballerina" name = "file" -version = "1.7.0" +version = "1.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "os"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] [[package]] org = "ballerina" name = "http" -version = "2.7.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -80,6 +77,7 @@ dependencies = [ {org = "ballerina", name = "lang.array"}, {org = "ballerina", name = "lang.decimal"}, {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, {org = "ballerina", name = "lang.runtime"}, {org = "ballerina", name = "lang.string"}, {org = "ballerina", name = "lang.value"}, @@ -87,18 +85,18 @@ dependencies = [ {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "observe"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] modules = [ - {org = "ballerina", packageName = "http", moduleName = "http"} + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} ] [[package]] org = "ballerina" name = "io" -version = "1.4.0" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -112,7 +110,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jballerina.java.arrays" -version = "1.2.3" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -120,7 +118,7 @@ dependencies = [ [[package]] org = "ballerina" name = "jwt" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -128,7 +126,6 @@ dependencies = [ {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, {org = "ballerina", name = "log"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] @@ -158,6 +155,15 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + [[package]] org = "ballerina" name = "lang.int" @@ -212,7 +218,7 @@ modules = [ [[package]] org = "ballerina" name = "log" -version = "2.7.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -226,7 +232,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.7.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -236,7 +242,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -249,7 +255,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.0.7" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -257,7 +263,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.6.0" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -266,7 +272,7 @@ dependencies = [ [[package]] org = "ballerina" name = "regex" -version = "1.4.2" +version = "1.4.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.string"} @@ -275,7 +281,7 @@ dependencies = [ [[package]] org = "ballerina" name = "sql" -version = "1.8.0" +version = "1.11.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -289,7 +295,7 @@ modules = [ [[package]] org = "ballerina" name = "task" -version = "2.3.2" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -301,7 +307,8 @@ name = "test" version = "0.0.0" scope = "testOnly" dependencies = [ - {org = "ballerina", name = "jballerina.java"} + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.error"} ] modules = [ {org = "ballerina", packageName = "test", moduleName = "test"} @@ -310,15 +317,18 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.2.4" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +modules = [ + {org = "ballerina", packageName = "time", moduleName = "time"} +] [[package]] org = "ballerina" name = "url" -version = "2.2.3" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -326,12 +336,11 @@ dependencies = [ [[package]] org = "ballerina" name = "uuid" -version = "1.5.0" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] modules = [ @@ -353,7 +362,7 @@ modules = [ [[package]] org = "ballerinax" name = "postgresql" -version = "1.8.0" +version = "1.11.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "io"}, @@ -376,6 +385,7 @@ dependencies = [ {org = "ballerina", name = "log"}, {org = "ballerina", name = "sql"}, {org = "ballerina", name = "test"}, + {org = "ballerina", name = "time"}, {org = "ballerina", name = "uuid"}, {org = "ballerinai", name = "observe"}, {org = "ballerinax", name = "postgresql"}, @@ -398,6 +408,7 @@ dependencies = [ {org = "ballerina", name = "lang.value"}, {org = "ballerina", name = "log"}, {org = "ballerina", name = "os"}, + {org = "ballerina", name = "regex"}, {org = "ballerina", name = "sql"}, {org = "ballerina", name = "uuid"}, {org = "ballerinax", name = "postgresql"} diff --git a/admin/admin-domain-service/ballerina/Dependencies.toml.template b/admin/admin-domain-service/ballerina/Dependencies.toml.template index 78acb5513..259732a98 100644 --- a/admin/admin-domain-service/ballerina/Dependencies.toml.template +++ b/admin/admin-domain-service/ballerina/Dependencies.toml.template @@ -5,25 +5,24 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.5.0" +distribution-version = "2201.8.0" [[package]] org = "ballerina" name = "auth" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.array"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "regex"} + {org = "ballerina", name = "log"} ] [[package]] org = "ballerina" name = "cache" -version = "3.4.0" +version = "3.7.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -34,7 +33,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.1.0" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -45,7 +44,7 @@ modules = [ [[package]] org = "ballerina" name = "crypto" -version = "2.3.0" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -54,20 +53,18 @@ dependencies = [ [[package]] org = "ballerina" name = "file" -version = "1.7.0" +version = "1.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "os"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] [[package]] org = "ballerina" name = "http" -version = "2.7.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -80,6 +77,7 @@ dependencies = [ {org = "ballerina", name = "lang.array"}, {org = "ballerina", name = "lang.decimal"}, {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, {org = "ballerina", name = "lang.runtime"}, {org = "ballerina", name = "lang.string"}, {org = "ballerina", name = "lang.value"}, @@ -87,18 +85,18 @@ dependencies = [ {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "observe"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] modules = [ - {org = "ballerina", packageName = "http", moduleName = "http"} + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} ] [[package]] org = "ballerina" name = "io" -version = "1.4.0" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -112,7 +110,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jballerina.java.arrays" -version = "1.2.3" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -120,7 +118,7 @@ dependencies = [ [[package]] org = "ballerina" name = "jwt" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -128,7 +126,6 @@ dependencies = [ {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, {org = "ballerina", name = "log"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] @@ -158,6 +155,15 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + [[package]] org = "ballerina" name = "lang.int" @@ -212,7 +218,7 @@ modules = [ [[package]] org = "ballerina" name = "log" -version = "2.7.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -226,7 +232,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.7.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -236,7 +242,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -249,7 +255,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.0.7" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -257,7 +263,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.6.0" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -266,7 +272,7 @@ dependencies = [ [[package]] org = "ballerina" name = "regex" -version = "1.4.2" +version = "1.4.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.string"} @@ -275,7 +281,7 @@ dependencies = [ [[package]] org = "ballerina" name = "sql" -version = "1.8.0" +version = "1.11.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -289,7 +295,7 @@ modules = [ [[package]] org = "ballerina" name = "task" -version = "2.3.2" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -301,7 +307,8 @@ name = "test" version = "0.0.0" scope = "testOnly" dependencies = [ - {org = "ballerina", name = "jballerina.java"} + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.error"} ] modules = [ {org = "ballerina", packageName = "test", moduleName = "test"} @@ -310,15 +317,18 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.2.4" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +modules = [ + {org = "ballerina", packageName = "time", moduleName = "time"} +] [[package]] org = "ballerina" name = "url" -version = "2.2.3" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -326,12 +336,11 @@ dependencies = [ [[package]] org = "ballerina" name = "uuid" -version = "1.5.0" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] modules = [ @@ -353,7 +362,7 @@ modules = [ [[package]] org = "ballerinax" name = "postgresql" -version = "1.8.0" +version = "1.11.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "io"}, @@ -376,6 +385,7 @@ dependencies = [ {org = "ballerina", name = "log"}, {org = "ballerina", name = "sql"}, {org = "ballerina", name = "test"}, + {org = "ballerina", name = "time"}, {org = "ballerina", name = "uuid"}, {org = "ballerinai", name = "observe"}, {org = "ballerinax", name = "postgresql"}, @@ -398,6 +408,7 @@ dependencies = [ {org = "ballerina", name = "lang.value"}, {org = "ballerina", name = "log"}, {org = "ballerina", name = "os"}, + {org = "ballerina", name = "regex"}, {org = "ballerina", name = "sql"}, {org = "ballerina", name = "uuid"}, {org = "ballerinax", name = "postgresql"} diff --git a/admin/admin-domain-service/ballerina/admin-api_service.bal b/admin/admin-domain-service/ballerina/admin-api_service.bal index 74fda9217..d6be998b6 100644 --- a/admin/admin-domain-service/ballerina/admin-api_service.bal +++ b/admin/admin-domain-service/ballerina/admin-api_service.bal @@ -20,7 +20,11 @@ import ballerina/http; import ballerina/log; import wso2/apk_common_lib as commons; -service /api/admin on ep0 { +service http:InterceptableService /api/admin on ep0 { + public function createInterceptors() returns http:Interceptor|http:Interceptor[] { + http:Interceptor[] interceptors = [jwtValidationInterceptor, requestErrorInterceptor, responseErrorInterceptor]; + return interceptors; + } # Retrieve/Search Policies # # + query - **Search**. You can search by providing a keyword. Allowed to search by type and name only. diff --git a/admin/admin-domain-service/ballerina/init.bal b/admin/admin-domain-service/ballerina/init.bal index 5a5a5ed48..03d26a4e3 100644 --- a/admin/admin-domain-service/ballerina/init.bal +++ b/admin/admin-domain-service/ballerina/init.bal @@ -33,7 +33,7 @@ configurable commons:IDPConfiguration idpConfiguration = { publicKey: {certFilePath: "/home/wso2apk/admin/security/mg.pem"} }; commons:DBBasedOrgResolver organizationResolver = new (datasourceConfiguration); -commons:JWTValidationInterceptor jwtValidationInterceptor = new (idpConfiguration, organizationResolver); +commons:JWTValidationInterceptor jwtValidationInterceptor = new (idpConfiguration, organizationResolver, ["/health"]); commons:RequestErrorInterceptor requestErrorInterceptor = new; commons:ResponseErrorInterceptor responseErrorInterceptor = new; final keymanager:KeyManagerTypeInitializer keyManagerInitializer = new; @@ -42,13 +42,13 @@ listener http:Listener ep0 = new (9443, secureSocket = { certFile: keyStores.tls.certFilePath, keyFile: keyStores.tls.keyFilePath } -}, interceptors = [jwtValidationInterceptor, requestErrorInterceptor, responseErrorInterceptor]); +}); listener http:Listener internalAdminEp = new (9444, secureSocket = { 'key: { certFile: keyStores.tls.certFilePath, keyFile: keyStores.tls.keyFilePath } -}, interceptors = [requestErrorInterceptor, responseErrorInterceptor]); +}); configurable string keyManagerConntectorConfigurationFilePath = "/home/wso2apk/admin/keymanager"; function init() returns error? { _ = check keyManagerInitializer.initialize(keyManagerConntectorConfigurationFilePath); diff --git a/admin/admin-domain-service/ballerina/internal-admin-api_service.bal b/admin/admin-domain-service/ballerina/internal-admin-api_service.bal index 5f8651e13..00fbdd0d8 100644 --- a/admin/admin-domain-service/ballerina/internal-admin-api_service.bal +++ b/admin/admin-domain-service/ballerina/internal-admin-api_service.bal @@ -17,8 +17,13 @@ // import wso2/apk_common_lib as commons; +import ballerina/http; -service /api/internal/v1 on internalAdminEp { +service http:InterceptableService /api/internal/v1 on internalAdminEp { + public function createInterceptors() returns http:Interceptor|http:Interceptor[] { + http:Interceptor[] interceptors = [requestErrorInterceptor, responseErrorInterceptor]; + return interceptors; + } resource function get organizations(string? organizationName, string? organizationClaimValue) returns OrganizationList|error|commons:APKError { if organizationName is string && organizationClaimValue is () { Internal_Organization organizationByNameDAO = check getOrganizationByNameDAO(organizationName); diff --git a/backoffice/backoffice-domain-service/ballerina/Ballerina.toml b/backoffice/backoffice-domain-service/ballerina/Ballerina.toml index e49154483..fd61d3d2b 100644 --- a/backoffice/backoffice-domain-service/ballerina/Ballerina.toml +++ b/backoffice/backoffice-domain-service/ballerina/Ballerina.toml @@ -2,7 +2,7 @@ org = "wso2" name = "backoffice_service" version = "0.0.1-SNAPSHOT" -distribution = "2201.5.0" +distribution = "2201.8.0" [[dependency]] org = "wso2" diff --git a/backoffice/backoffice-domain-service/ballerina/Ballerina.toml.template b/backoffice/backoffice-domain-service/ballerina/Ballerina.toml.template index 0869b4b9b..e9dd73114 100644 --- a/backoffice/backoffice-domain-service/ballerina/Ballerina.toml.template +++ b/backoffice/backoffice-domain-service/ballerina/Ballerina.toml.template @@ -2,7 +2,7 @@ org = "wso2" name = "backoffice_service" version = "PROJECT_VERSION" -distribution = "2201.5.0" +distribution = "2201.8.0" [[dependency]] org = "wso2" diff --git a/backoffice/backoffice-domain-service/ballerina/Dependencies.toml b/backoffice/backoffice-domain-service/ballerina/Dependencies.toml index e48e0bcdf..418ee5d3d 100644 --- a/backoffice/backoffice-domain-service/ballerina/Dependencies.toml +++ b/backoffice/backoffice-domain-service/ballerina/Dependencies.toml @@ -5,25 +5,24 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.5.0" +distribution-version = "2201.8.0" [[package]] org = "ballerina" name = "auth" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.array"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "regex"} + {org = "ballerina", name = "log"} ] [[package]] org = "ballerina" name = "cache" -version = "3.4.0" +version = "3.7.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -34,7 +33,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.1.0" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -45,7 +44,7 @@ modules = [ [[package]] org = "ballerina" name = "crypto" -version = "2.3.0" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -54,20 +53,18 @@ dependencies = [ [[package]] org = "ballerina" name = "file" -version = "1.7.0" +version = "1.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "os"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] [[package]] org = "ballerina" name = "grpc" -version = "1.7.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "crypto"}, @@ -77,14 +74,13 @@ dependencies = [ {org = "ballerina", name = "log"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "protobuf"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] [[package]] org = "ballerina" name = "http" -version = "2.7.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -97,6 +93,7 @@ dependencies = [ {org = "ballerina", name = "lang.array"}, {org = "ballerina", name = "lang.decimal"}, {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, {org = "ballerina", name = "lang.runtime"}, {org = "ballerina", name = "lang.string"}, {org = "ballerina", name = "lang.value"}, @@ -104,18 +101,18 @@ dependencies = [ {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "observe"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] modules = [ - {org = "ballerina", packageName = "http", moduleName = "http"} + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} ] [[package]] org = "ballerina" name = "io" -version = "1.4.1" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -132,7 +129,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jballerina.java.arrays" -version = "1.2.3" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -140,7 +137,7 @@ dependencies = [ [[package]] org = "ballerina" name = "jwt" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -148,7 +145,6 @@ dependencies = [ {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, {org = "ballerina", name = "log"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] @@ -178,6 +174,15 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + [[package]] org = "ballerina" name = "lang.int" @@ -237,7 +242,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.7.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -251,7 +256,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.7.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -264,7 +269,7 @@ modules = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -277,7 +282,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.0.7" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -285,7 +290,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.6.0" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -294,7 +299,7 @@ dependencies = [ [[package]] org = "ballerina" name = "protobuf" -version = "1.3.2" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -312,7 +317,7 @@ dependencies = [ [[package]] org = "ballerina" name = "sql" -version = "1.8.0" +version = "1.11.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -326,7 +331,7 @@ modules = [ [[package]] org = "ballerina" name = "task" -version = "2.3.2" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -338,7 +343,8 @@ name = "test" version = "0.0.0" scope = "testOnly" dependencies = [ - {org = "ballerina", name = "jballerina.java"} + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.error"} ] modules = [ {org = "ballerina", packageName = "test", moduleName = "test"} @@ -347,7 +353,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.2.4" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -358,7 +364,7 @@ modules = [ [[package]] org = "ballerina" name = "url" -version = "2.2.3" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -366,12 +372,11 @@ dependencies = [ [[package]] org = "ballerina" name = "uuid" -version = "1.5.0" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] modules = [ @@ -414,7 +419,7 @@ modules = [ [[package]] org = "ballerinax" name = "postgresql" -version = "1.8.0" +version = "1.11.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "io"}, @@ -438,6 +443,7 @@ dependencies = [ {org = "ballerina", name = "lang.value"}, {org = "ballerina", name = "log"}, {org = "ballerina", name = "os"}, + {org = "ballerina", name = "regex"}, {org = "ballerina", name = "sql"}, {org = "ballerina", name = "uuid"}, {org = "ballerinax", name = "postgresql"} diff --git a/backoffice/backoffice-domain-service/ballerina/Dependencies.toml.template b/backoffice/backoffice-domain-service/ballerina/Dependencies.toml.template index e48e0bcdf..5c08b6a37 100644 --- a/backoffice/backoffice-domain-service/ballerina/Dependencies.toml.template +++ b/backoffice/backoffice-domain-service/ballerina/Dependencies.toml.template @@ -5,25 +5,24 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.5.0" +distribution-version = "2201.8.0" [[package]] org = "ballerina" name = "auth" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.array"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "regex"} + {org = "ballerina", name = "log"} ] [[package]] org = "ballerina" name = "cache" -version = "3.4.0" +version = "3.7.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -34,7 +33,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.1.0" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -45,7 +44,7 @@ modules = [ [[package]] org = "ballerina" name = "crypto" -version = "2.3.0" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -54,20 +53,18 @@ dependencies = [ [[package]] org = "ballerina" name = "file" -version = "1.7.0" +version = "1.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "os"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] [[package]] org = "ballerina" name = "grpc" -version = "1.7.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "crypto"}, @@ -77,14 +74,13 @@ dependencies = [ {org = "ballerina", name = "log"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "protobuf"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] [[package]] org = "ballerina" name = "http" -version = "2.7.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -97,6 +93,7 @@ dependencies = [ {org = "ballerina", name = "lang.array"}, {org = "ballerina", name = "lang.decimal"}, {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, {org = "ballerina", name = "lang.runtime"}, {org = "ballerina", name = "lang.string"}, {org = "ballerina", name = "lang.value"}, @@ -104,18 +101,18 @@ dependencies = [ {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "observe"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] modules = [ - {org = "ballerina", packageName = "http", moduleName = "http"} + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} ] [[package]] org = "ballerina" name = "io" -version = "1.4.1" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -132,7 +129,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jballerina.java.arrays" -version = "1.2.3" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -140,7 +137,7 @@ dependencies = [ [[package]] org = "ballerina" name = "jwt" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -148,7 +145,6 @@ dependencies = [ {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, {org = "ballerina", name = "log"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] @@ -178,6 +174,15 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + [[package]] org = "ballerina" name = "lang.int" @@ -237,7 +242,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.7.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -251,7 +256,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.7.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -264,7 +269,7 @@ modules = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.7.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -277,7 +282,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.0.7" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -285,7 +290,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.6.0" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -294,7 +299,7 @@ dependencies = [ [[package]] org = "ballerina" name = "protobuf" -version = "1.3.2" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -312,7 +317,7 @@ dependencies = [ [[package]] org = "ballerina" name = "sql" -version = "1.8.0" +version = "1.11.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -326,7 +331,7 @@ modules = [ [[package]] org = "ballerina" name = "task" -version = "2.3.2" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -338,7 +343,8 @@ name = "test" version = "0.0.0" scope = "testOnly" dependencies = [ - {org = "ballerina", name = "jballerina.java"} + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.error"} ] modules = [ {org = "ballerina", packageName = "test", moduleName = "test"} @@ -347,7 +353,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.2.4" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -358,7 +364,7 @@ modules = [ [[package]] org = "ballerina" name = "url" -version = "2.2.3" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -366,12 +372,11 @@ dependencies = [ [[package]] org = "ballerina" name = "uuid" -version = "1.5.0" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, - {org = "ballerina", name = "regex"}, {org = "ballerina", name = "time"} ] modules = [ @@ -414,7 +419,7 @@ modules = [ [[package]] org = "ballerinax" name = "postgresql" -version = "1.8.0" +version = "1.11.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "io"}, @@ -438,6 +443,7 @@ dependencies = [ {org = "ballerina", name = "lang.value"}, {org = "ballerina", name = "log"}, {org = "ballerina", name = "os"}, + {org = "ballerina", name = "regex"}, {org = "ballerina", name = "sql"}, {org = "ballerina", name = "uuid"}, {org = "ballerinax", name = "postgresql"} @@ -451,7 +457,7 @@ modules = [ [[package]] org = "wso2" name = "backoffice_service" -version = "0.0.1-SNAPSHOT" +version = "PROJECT_VERSION" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, diff --git a/backoffice/backoffice-domain-service/ballerina/backoffice-api_service.bal b/backoffice/backoffice-domain-service/ballerina/backoffice-api_service.bal index 47285178c..7263d746d 100644 --- a/backoffice/backoffice-domain-service/ballerina/backoffice-api_service.bal +++ b/backoffice/backoffice-domain-service/ballerina/backoffice-api_service.bal @@ -28,7 +28,7 @@ listener http:Listener ep0 = new (BACKOFFICE_PORT, secureSocket = { certFile: keyStores.tls.certFilePath, keyFile: keyStores.tls.keyFilePath } -}, interceptors = [jwtValidationInterceptor, requestErrorInterceptor, responseErrorInterceptor]); +}); @http:ServiceConfig { cors: { @@ -40,8 +40,12 @@ listener http:Listener ep0 = new (BACKOFFICE_PORT, secureSocket = { } } -service /api/backoffice on ep0 { +service http:InterceptableService /api/backoffice on ep0 { + public function createInterceptors() returns http:Interceptor|http:Interceptor[] { + http:Interceptor[] interceptors = [jwtValidationInterceptor, requestErrorInterceptor, responseErrorInterceptor]; + return interceptors; + } isolated resource function get apis(http:RequestContext requestContext, string? query, @http:Header string? 'if\-none\-match, int 'limit = 25, int offset = 0, string sortBy = "createdTime", string sortOrder = "desc", @http:Header string? accept = "application/json") returns APIList|http:NotModified|commons:APKError { commons:UserContext authenticatedUserContext = check commons:getAuthenticatedUserContext(requestContext); commons:Organization organization = authenticatedUserContext.organization; diff --git a/backoffice/backoffice-domain-service/ballerina/backoffice-internal-api_service.bal b/backoffice/backoffice-domain-service/ballerina/backoffice-internal-api_service.bal index 3824d6c33..95e1ce1ba 100644 --- a/backoffice/backoffice-domain-service/ballerina/backoffice-internal-api_service.bal +++ b/backoffice/backoffice-domain-service/ballerina/backoffice-internal-api_service.bal @@ -7,9 +7,14 @@ listener http:Listener ep1 = new (BACKOFFICE_PORT_INT, secureSocket = { certFile: keyStores.tls.certFilePath, keyFile: keyStores.tls.keyFilePath } -}, interceptors = [requestErrorInterceptor, responseErrorInterceptor]); +}); -service /api/backoffice/internal on ep1 { +service http:InterceptableService /api/backoffice/internal on ep1 { + + public function createInterceptors() returns http:Interceptor|http:Interceptor[] { + http:Interceptor[] interceptors = [requestErrorInterceptor, responseErrorInterceptor]; + return interceptors; + } isolated resource function post apis(@http:Payload json payload) returns CreatedAPI|error { APIBody apiBody = check payload.cloneWithType(APIBody); diff --git a/backoffice/backoffice-domain-service/ballerina/init.bal b/backoffice/backoffice-domain-service/ballerina/init.bal index 704bb8e3c..f3d64b9f2 100644 --- a/backoffice/backoffice-domain-service/ballerina/init.bal +++ b/backoffice/backoffice-domain-service/ballerina/init.bal @@ -34,7 +34,7 @@ configurable KeyStores & readonly keyStores = { }; commons:DBBasedOrgResolver organizationResolver = new (datasourceConfiguration); -commons:JWTValidationInterceptor jwtValidationInterceptor = new (idpConfiguration, organizationResolver); +commons:JWTValidationInterceptor jwtValidationInterceptor = new (idpConfiguration, organizationResolver, ["/health"]); commons:RequestErrorInterceptor requestErrorInterceptor = new; commons:ResponseErrorInterceptor responseErrorInterceptor = new; diff --git a/backoffice/backoffice-domain-service/ballerina/types.bal b/backoffice/backoffice-domain-service/ballerina/types.bal index d495972d7..c802bda53 100644 --- a/backoffice/backoffice-domain-service/ballerina/types.bal +++ b/backoffice/backoffice-domain-service/ballerina/types.bal @@ -151,7 +151,7 @@ public type APIOperations record { public type APIList record { # Number of APIs returned. int count?; - APIInfo[] list?; + API[] list?; Pagination pagination?; };