From 426ca093091bb78b978b892c5b6ce8d02353ec59 Mon Sep 17 00:00:00 2001 From: KRVPerera Date: Mon, 15 Jun 2020 08:26:20 +0530 Subject: [PATCH] Fix: websub auth annotation fix --- .../http/src/main/ballerina/src/http/annotation.bal | 12 ++++++------ .../src/main/ballerina/src/websub/hub_service.bal | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/stdlib/http/src/main/ballerina/src/http/annotation.bal b/stdlib/http/src/main/ballerina/src/http/annotation.bal index 2d931f5a6e20..25d7ae02675d 100644 --- a/stdlib/http/src/main/ballerina/src/http/annotation.bal +++ b/stdlib/http/src/main/ballerina/src/http/annotation.bal @@ -137,9 +137,9 @@ public type WebSocketUpgradeConfig record {| # be successfully authorized. An array consisting of arrays is used to indicate that at least one scope from the sub-arrays # should be successfully authorized. public type ServiceAuth record {| - boolean enabled = true; - InboundAuthHandlers authHandlers?; - Scopes scopes?; + readonly boolean enabled = true; + readonly InboundAuthHandlers authHandlers?; + readonly Scopes scopes?; |}; # Configures the authentication scheme for a resource. @@ -152,9 +152,9 @@ public type ServiceAuth record {| # be successfully authorized. An array consisting of arrays is used to indicate that at least one scope from the sub-arrays # should be successfully authorized. public type ResourceAuth record {| - boolean enabled?; - InboundAuthHandlers authHandlers?; - Scopes scopes?; + readonly boolean enabled?; + readonly InboundAuthHandlers authHandlers?; + readonly Scopes scopes?; |}; # The annotation which is used to configure an HTTP resource. diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal index 832533b34a4d..a788335315e2 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal @@ -35,14 +35,14 @@ cache:Cache subscriberCallbackClientCache = new(config); function getHubService() returns service { return @http:ServiceConfig { basePath: hubBasePath, - auth: hubServiceAuth + auth: hubServiceAuth } service { @http:ResourceConfig { methods: ["POST"], path: hubPublishResourcePath, - auth: hubPublisherResourceAuth + auth: hubPublisherResourceAuth } resource function publish(http:Caller httpCaller, http:Request request) { http:Response response = new; @@ -211,7 +211,7 @@ function getHubService() returns service { @http:ResourceConfig { methods: ["POST"], path: hubSubscriptionResourcePath, - auth: hubSubscriptionResourceAuth + auth: hubSubscriptionResourceAuth } resource function subscribe(http:Caller httpCaller, http:Request request) { http:Response response = new;