From bf06eed527952fb7c56db662382d3c85a28f6e64 Mon Sep 17 00:00:00 2001 From: ThishaniLucas Date: Tue, 15 Aug 2023 14:40:54 +0530 Subject: [PATCH] Add support for authz service and prepare release 1.0.2 --- Ballerina.toml | 9 ++++-- Dependencies.toml | 80 +++++++++++++++++++++++++++-------------------- api_config.bal | 10 +++++- 3 files changed, 62 insertions(+), 37 deletions(-) diff --git a/Ballerina.toml b/Ballerina.toml index f9ae45c..810a305 100644 --- a/Ballerina.toml +++ b/Ballerina.toml @@ -1,10 +1,15 @@ [package] org = "wso2healthcare" name = "AUBasePatientAPI" -version = "1.0.1" -distribution = "2201.6.0" +version = "1.0.2" +distribution = "2201.7.0" authors = ["WSO2 Healthcare"] keywords = ["Healthcare", "FHIR", "Patient", "r4", "aubase"] [build-options] observabilityIncluded = true + +[[dependency]] +org="ballerinax" +name="health.fhir.r4" +version="4.1.0" diff --git a/Dependencies.toml b/Dependencies.toml index 724e49a..be23661 100644 --- a/Dependencies.toml +++ b/Dependencies.toml @@ -5,12 +5,12 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.6.0" +distribution-version = "2201.7.0" [[package]] org = "ballerina" name = "auth" -version = "2.8.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -22,7 +22,7 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.5.0" +version = "3.6.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -33,7 +33,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.2.0" +version = "1.3.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -41,7 +41,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.3.1" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -50,7 +50,7 @@ dependencies = [ [[package]] org = "ballerina" name = "file" -version = "1.7.1" +version = "1.8.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -61,7 +61,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.8.1" +version = "2.9.2" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -86,13 +86,14 @@ dependencies = [ {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.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -106,7 +107,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.8.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -194,7 +195,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.7.1" +version = "2.8.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -208,7 +209,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.7.1" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -218,7 +219,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.8.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -231,7 +232,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.0.7" +version = "1.1.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -239,7 +240,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.6.1" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -260,7 +261,7 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.3.3" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -269,7 +270,7 @@ dependencies = [ [[package]] org = "ballerina" name = "time" -version = "2.2.5" +version = "2.3.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -277,7 +278,7 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.2.4" +version = "2.3.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -285,7 +286,7 @@ dependencies = [ [[package]] org = "ballerina" name = "uuid" -version = "1.5.1" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -322,7 +323,7 @@ dependencies = [ [[package]] org = "ballerinax" name = "health.fhir.r4" -version = "3.0.1" +version = "4.1.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, @@ -333,20 +334,16 @@ dependencies = [ {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"}, {org = "ballerina", name = "uuid"}, - {org = "ballerinax", name = "health.base"}, - {org = "ballerinax", name = "health.fhir.r4utils"} + {org = "ballerinax", name = "health.base"} ] modules = [ - {org = "ballerinax", packageName = "health.fhir.r4", moduleName = "health.fhir.r4"}, - {org = "ballerinax", packageName = "health.fhir.r4", moduleName = "health.fhir.r4.parser"}, - {org = "ballerinax", packageName = "health.fhir.r4", moduleName = "health.fhir.r4.terminology"}, - {org = "ballerinax", packageName = "health.fhir.r4", moduleName = "health.fhir.r4.validator"} + {org = "ballerinax", packageName = "health.fhir.r4", moduleName = "health.fhir.r4"} ] [[package]] org = "ballerinax" name = "health.fhir.r4.aubase410" -version = "1.0.5" +version = "1.0.7" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "log"}, @@ -358,23 +355,38 @@ modules = [ [[package]] org = "ballerinax" -name = "health.fhir.r4utils" -version = "1.0.2" +name = "health.fhir.r4.international401" +version = "1.0.0" dependencies = [ - {org = "ballerina", name = "lang.int"}, - {org = "ballerina", name = "regex"} + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "log"}, + {org = "ballerinax", name = "health.fhir.r4"} +] + +[[package]] +org = "ballerinax" +name = "health.fhir.r4.parser" +version = "4.0.0" +dependencies = [ + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "log"}, + {org = "ballerinax", name = "health.fhir.r4"}, + {org = "ballerinax", name = "health.fhir.r4.international401"} ] [[package]] org = "ballerinax" name = "health.fhirr4" -version = "1.0.6" +version = "1.0.8" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "log"}, {org = "ballerina", name = "regex"}, {org = "ballerinai", name = "observe"}, - {org = "ballerinax", name = "health.fhir.r4"} + {org = "ballerinax", name = "health.fhir.r4"}, + {org = "ballerinax", name = "health.fhir.r4.parser"} ] modules = [ {org = "ballerinax", packageName = "health.fhirr4", moduleName = "health.fhirr4"} @@ -383,7 +395,7 @@ modules = [ [[package]] org = "wso2healthcare" name = "AUBasePatientAPI" -version = "1.0.1" +version = "1.0.2" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "log"}, diff --git a/api_config.bal b/api_config.bal index ea94c15..7af76f0 100644 --- a/api_config.bal +++ b/api_config.bal @@ -21,6 +21,10 @@ // Developers are allowed modify this file as per the requirement. import ballerinax/health.fhir.r4; +import ballerina/os; + +configurable string authzServiceUrl = os:getEnv("AUTHZ_SERVICE_URL"); +configurable string priviledgedClaimUrl = os:getEnv("PRIVILEDGED_CLAIM_URL"); final r4:ResourceAPIConfig apiConfig = { resourceType: "Patient", @@ -240,5 +244,9 @@ final r4:ResourceAPIConfig apiConfig = { operations: [ ], - serverConfig: () + serverConfig: (), + authzConfig: authzServiceUrl.length() > 0 ? { + authzServiceUrl: authzServiceUrl, + privilegedClaimUrl: priviledgedClaimUrl.length() > 0 ? priviledgedClaimUrl : () + } : () };