Skip to content

Instantly share code, notes, and snippets.

@ldclakmal
Last active February 9, 2022 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ldclakmal/6d3265b16fd463b473889a20ca23359b to your computer and use it in GitHub Desktop.
Save ldclakmal/6d3265b16fd463b473889a20ca23359b to your computer and use it in GitHub Desktop.
import ballerina/grpc;
GrpcClient clientEP = check new("https://localhost:9191",
auth = {
issuer: "order-service",
audience: ["payment-service", "delivery-service"],
keyId: "5a0b754-895f-4279-8843-b745e11a57e9",
jwtId: "JlbmMiOiJBMTI4Q0JDLUhTMjU2In",
customClaims: { "scp": "admin" },
expTime: 3600,
signatureConfig: {
config: {
keyFile: "/path/to/order-service-private.key"
}
}
},
secureSocket = {
cert: "/path/to/public.crt"
}
);
service /foo on ordersEP {
resource function post bar() returns json|error {
// business logic
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment