Skip to content

Commit

Permalink
Fix: websub auth annotation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KRVPerera committed Jun 15, 2020
1 parent 098f221 commit 426ca09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions stdlib/http/src/main/ballerina/src/http/annotation.bal
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions stdlib/websub/src/main/ballerina/src/websub/hub_service.bal
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ cache:Cache subscriberCallbackClientCache = new(config);
function getHubService() returns service {
return @http:ServiceConfig {
basePath: hubBasePath,
auth: <http:ServiceAuth & readonly>hubServiceAuth
auth: hubServiceAuth
}
service {

@http:ResourceConfig {
methods: ["POST"],
path: hubPublishResourcePath,
auth: <http:ResourceAuth & readonly>hubPublisherResourceAuth
auth: hubPublisherResourceAuth
}
resource function publish(http:Caller httpCaller, http:Request request) {
http:Response response = new;
Expand Down Expand Up @@ -211,7 +211,7 @@ function getHubService() returns service {
@http:ResourceConfig {
methods: ["POST"],
path: hubSubscriptionResourcePath,
auth: <http:ResourceAuth & readonly>hubSubscriptionResourceAuth
auth: hubSubscriptionResourceAuth
}
resource function subscribe(http:Caller httpCaller, http:Request request) {
http:Response response = new;
Expand Down

0 comments on commit 426ca09

Please sign in to comment.