In the following BBE, scopes are defined at the service level.
Is there a way to define the expected scopes at the resource level?
We can do it by using @http:ResourceConfig
annotation.
https://lib.ballerina.io/ballerina/http/latest#HttpResourceConfig
ex:
@http:ResourceConfig {
auth: {
scopes: ["admin"]
}
}
resource function get albums() returns Album[] {
return [
{title: "Blue Train", artist: "John Coltrane"},
{title: "Jeru", artist: "Gerry Mulligan"}
];
}
}