Last active
February 9, 2022 13:26
-
-
Save ldclakmal/7d0b04c3244153c54e415171aacb5a1d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/grpc; | |
import ballerina/jwt; | |
listener grpc:Listener paymentsEP = new(9191, | |
secureSocket = { | |
key: { | |
certFile: "/path/to/public.crt", | |
keyFile: "/path/to/private.key" | |
} | |
} | |
); | |
@grpc:ServiceConfig { | |
auth: [ | |
{ | |
jwtValidatorConfig: { | |
issuer: "order-service", | |
audience: "payment-service", | |
signatureConfig: { | |
certFile: "/path/to/order-service-public.crt" | |
}, | |
scopeKey: "scp" | |
}, | |
scopes: ["admin"] | |
} | |
] | |
} | |
@grpc:ServiceDescriptor { | |
descriptor: ROOT_DESCRIPTOR, | |
descMap: getDescriptorMap() | |
} | |
service "PaymentService" on paymentsEP { | |
remote function payments(ContextString request) returns string { | |
// business logic | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment