forked from ballerina-platform/module-ballerina-c2c
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e908fc1
commit 3fb4300
Showing
4 changed files
with
61 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
8 changes: 8 additions & 0 deletions
8
compiler-plugin-tests/src/test/resources/service/listener-variable/Ballerina.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
org = "ballerina" | ||
name = "clientconfig" | ||
version = "0.1.0" | ||
|
||
[build-options] | ||
observabilityIncluded = true | ||
cloud = "k8s" |
36 changes: 36 additions & 0 deletions
36
compiler-plugin-tests/src/test/resources/service/listener-variable/service.bal
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import ballerina/log; | ||
import ballerina/http; | ||
|
||
isolated service /registerAPI on internalLs { | ||
|
||
isolated resource function post .(string apiName, string candidateGateway) | ||
returns http:Created|http:InternalServerError { | ||
do { | ||
log:printInfo("Registering API: " + apiName + " with gateway: " + candidateGateway); | ||
} on fail { | ||
return http:INTERNAL_SERVER_ERROR; | ||
} | ||
log:printInfo("Registered API: " + apiName + " with gateway: " + candidateGateway); | ||
return http:CREATED; | ||
} | ||
} | ||
|
||
configurable int INTERNAL_SERVICE_PORT = 9090; | ||
configurable string ADMIN_SERVICE_HOST = "localhost:9443"; | ||
configurable string CERT_PATH = "./resources/wso2carbon.cer"; | ||
configurable string ADMIN_SERVICE_SCOPES = "apim:tenant_theme_manage apim:tier_manage apim:tier_view openid"; | ||
configurable string TOKEN_URL = "https://localhost:9443/oauth2/token"; | ||
configurable string CLIENT_ID = "xxxxxxx"; | ||
configurable string CLIENT_SECRET = "xxxxxxx"; | ||
|
||
final http:Client apimAdmin = check new (ADMIN_SERVICE_HOST, auth = { | ||
tokenUrl: TOKEN_URL, | ||
clientId: CLIENT_ID, | ||
clientSecret: CLIENT_SECRET, | ||
scopes: ADMIN_SERVICE_SCOPES, | ||
clientConfig: { | ||
secureSocket: {cert: CERT_PATH} | ||
} | ||
}, secureSocket = {cert: CERT_PATH}); | ||
|
||
public listener http:Listener internalLs = new (INTERNAL_SERVICE_PORT); |