Skip to content

Commit

Permalink
Merge pull request #2 from Nuvindu/gradle-wrapper
Browse files Browse the repository at this point in the history
Add missing gradle-wrapper jar file
  • Loading branch information
Nuvindu authored Mar 7, 2024
2 parents d3d3728 + 9966fb0 commit 2e0cf06
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 627 deletions.
6 changes: 5 additions & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.10.7"
version = "2.10.8"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -217,6 +217,9 @@ dependencies = [
{org = "ballerina", name = "lang.value"},
{org = "ballerina", name = "observe"}
]
modules = [
{org = "ballerina", packageName = "log", moduleName = "log"}
]

[[package]]
org = "ballerina"
Expand Down Expand Up @@ -310,6 +313,7 @@ dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "io"},
{org = "ballerina", name = "lang.array"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "os"},
{org = "ballerina", name = "test"},
{org = "ballerina", name = "url"}
Expand Down
7 changes: 7 additions & 0 deletions ballerina/tests/Config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[docusign.dsclick]
clientId = "mock-client-id"
clientSecret = "mock-client-secret"
refreshToken = "mock-refresh-token"
refreshUrl = "http://localhost:9444/oauth2/token"
accountId = "mock-account-id"
userId = "mock-user-id"
41 changes: 41 additions & 0 deletions ballerina/tests/sts_mock_service.bal
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com) All Rights Reserved.
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/http;
import ballerina/log;

configurable int HTTP_SERVER_PORT = 9444;
configurable int TOKEN_VALIDITY_PERIOD = 10000; // in seconds

listener http:Listener sts = new (HTTP_SERVER_PORT);

service /oauth2 on sts {

function init() {
log:printInfo("Mock security token service started on port: " + HTTP_SERVER_PORT.toString() + " (HTTP)");
}

// This issues an access token with reference to the received grant type (client credentials, password and refresh token grant type).
resource function post token(http:Request req) returns json {
json response = {
"access_token": "dskjbdsfJBDABJDnklsa2p93un03",
"token_type": "mock-token",
"expires_in": TOKEN_VALIDITY_PERIOD,
"example_parameter": "example_value"
};
return response;
}
}
6 changes: 6 additions & 0 deletions examples/return-policy-agreement/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ name = "return_policy_agreement"
version = "0.1.0"
distribution = "2201.8.4"

[[dependency]]
org = "ballerinax"
name = "docusign.dsclick"
version = "1.0.0"
repository = "local"

[build-options]
observabilityIncluded = true
Loading

0 comments on commit 2e0cf06

Please sign in to comment.