You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# + autoVerifySubscription - Configuration to enable or disable automatic subscription verification
226
228
public type ServiceConfiguration record {|
227
229
int leaseSeconds?;
228
230
ClientConfiguration webHookConfig?;
231
+
boolean autoVerifySubscription = false;
229
232
|};
230
233
```
231
234
@@ -375,6 +378,34 @@ This is due to the limited information in the WebSub specification on the relati
375
378
In the event of a bad request from the `publisher` or the `subscriber`, the WebSubHub dispatcher will automatically send
376
379
back the appropriate response to the client.
377
380
381
+
#### 2.2.3. Controller
382
+
383
+
When `autoVerifySubscription` is enabled in the `websubhub:ServiceConfig` annotation, the `websubhub:Controller` can be used to mark a
384
+
subscription or unsubscription as verified. This class is initialized exclusively within the WebSubHub framework and provides the
385
+
following API.
386
+
387
+
```ballerina
388
+
type Controller object {
389
+
390
+
# Marks a particular subscription as verified.
391
+
#
392
+
# + subscription - The `websubhub:Subscription` or `websubhub:Unsubscription` message
393
+
# + return - A `websubhub:Error` if the `websubhub:Service` has not enabled subscription auto-verification,
394
+
# or else nil
395
+
public isolated function markAsVerified(Subscription|Unsubscription subscription) returns Error?;
396
+
397
+
# Checks whether a particular subscription has been marked as verified. Please note that this
398
+
# is an internal API which is used within the WebSubHub dispatcher to identify whether
399
+
# to skip the subscrition intent verification for the subscription or unsubscription.
400
+
#
401
+
# + subscription - The `websubhub:Subscription` or `websubhub:Unsubscription` message
402
+
# + return - A `true` if the subscrition/unsubscription has been marked as verified or else `false`
403
+
isolated function skipSubscriptionVerification(Subscription|Unsubscription subscription) returns boolean;
404
+
};
405
+
```
406
+
407
+
> Note: The `websubhub:Controller` will be available only as an optional parameter in the `onSubscription` and `onUnsubscription` remote methods of the `websubhub:Service`.
408
+
378
409
### 2.3. Hub Client
379
410
380
411
In accordance with the [WebSub specification](https://www.w3.org/TR/websub/#content-distribution), `WebSubHub` package
0 commit comments