Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync 2201.10.0-stage and 2201.10.x branch #5610

Merged
merged 88 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
3577b92
update the latest sql version
daneshk Feb 26, 2024
9934d89
fix merge conflicts
daneshk Apr 13, 2024
62e8af8
Update BBEs for AccessLog Improvements
AzeemMuzammil Jul 11, 2024
a047bc8
Address review comments
AzeemMuzammil Jul 16, 2024
a691d85
Update http timestamp version
MohamedSabthar Aug 2, 2024
16b756e
Add Server-Sent Events BBE
MohamedSabthar Aug 2, 2024
c7d5964
Update crypto, jwt and mime versions
MohamedSabthar Aug 2, 2024
bc20a34
Rename variable
MohamedSabthar Aug 2, 2024
15af8f0
Include daily build for 2201.10.x
gabilang Aug 5, 2024
b97a7bd
Merge pull request #5535 from gabilang/add-daily-build-2201.10.x
NipunaMadhushan Aug 5, 2024
fe12b2d
Add data.yaml module to the distribution
LakshanWeerasinghe Aug 5, 2024
e4ac6ea
Merge pull request #5536 from LakshanWeerasinghe/data.yaml
LakshanWeerasinghe Aug 5, 2024
13c0122
Update data.yaml timestamp version
LakshanWeerasinghe Aug 5, 2024
bcaa94f
Merge pull request #5538 from LakshanWeerasinghe/data.yaml
LakshanWeerasinghe Aug 5, 2024
83c772b
Update examples/http-sse-client/http_sse_client.md
MohamedSabthar Aug 5, 2024
7c5f26d
Address review suggestions
MohamedSabthar Aug 5, 2024
0e7b03c
Add yaml to anydata sample
LakshanWeerasinghe Aug 1, 2024
cb29965
Add yaml to anydata with projection bbe
LakshanWeerasinghe Aug 1, 2024
2170bc9
Add anydata to yaml string bbe
LakshanWeerasinghe Aug 1, 2024
6c4b86c
Add yaml bbes to index.json
LakshanWeerasinghe Aug 1, 2024
1eb9b57
Address review suggestions
LakshanWeerasinghe Aug 6, 2024
84a51f1
Update samples with string templates
LakshanWeerasinghe Aug 6, 2024
4074315
Merge branch 'master' of https://github.com/ballerina-platform/baller…
daneshk Aug 8, 2024
adf7b23
Update the IO version
daneshk Aug 8, 2024
826833a
Merge pull request #5550 from daneshk/master
daneshk Aug 8, 2024
4b989b1
Add LDAP module into the Ballerina distribution
ayeshLK Aug 8, 2024
246f296
Merge pull request #5554 from ayeshLK/master
NipunaRanasinghe Aug 8, 2024
cab5906
Address review comments
AzeemMuzammil Aug 9, 2024
26445ad
Merge pull request #5504 from AzeemMuzammil/fb-access-log-bbe
TharmiganK Aug 9, 2024
da3254c
Address review suggestions
MohamedSabthar Aug 12, 2024
faa1641
Add comments in http_sse_service.bal
MohamedSabthar Aug 12, 2024
53444d3
Apply suggestions from code review
MohamedSabthar Aug 12, 2024
e0f39bd
Address review suggestions
MohamedSabthar Aug 12, 2024
54580a7
Add comments in http_sse_client.bal
MohamedSabthar Aug 12, 2024
7fd3e3a
Fix incorrect file path in GraphQL JWT BBE
ThisaruGuruge Aug 12, 2024
5e30d14
Merge pull request #5573 from ThisaruGuruge/master
ThisaruGuruge Aug 12, 2024
e832f4c
Add BBE for add/remove entries using LDAP
Nuvindu Aug 13, 2024
5ae9ffe
Add BBE for searching entries using LDAP
Nuvindu Aug 13, 2024
180f1e9
Index new BBEs for LDAP client
Nuvindu Aug 13, 2024
bbfc500
Apply suggestions from the review
Nuvindu Aug 13, 2024
4669146
Include comments in LDAP BBEs
Nuvindu Aug 13, 2024
b93fef0
Improve the code in the LDAP add/remove BBE
Nuvindu Aug 13, 2024
ea78221
Fix a typo in a BBE description
Nuvindu Aug 13, 2024
2ed9e31
Apply suggestions from code review
MohamedSabthar Aug 14, 2024
34e3a9b
Merge pull request #5533 from MohamedSabthar/master
MohamedSabthar Aug 14, 2024
0513c56
Address review suggestions
LakshanWeerasinghe Aug 15, 2024
b30e9aa
Apply review suggestions for LDAP BBEs
Nuvindu Aug 15, 2024
7adc890
Update related links in LDAP BBEs
Nuvindu Aug 15, 2024
beb07e4
Merge pull request #5578 from Nuvindu/2201.10.0-stage
Nuvindu Aug 20, 2024
d22bac7
Add yaml to anydata sample
LakshanWeerasinghe Aug 1, 2024
767dab1
Add yaml to anydata with projection bbe
LakshanWeerasinghe Aug 1, 2024
7f834b1
Add anydata to yaml string bbe
LakshanWeerasinghe Aug 1, 2024
c4efafa
Add yaml bbes to index.json
LakshanWeerasinghe Aug 1, 2024
3983e6e
Address review suggestions
LakshanWeerasinghe Aug 6, 2024
a6e6b79
Update samples with string templates
LakshanWeerasinghe Aug 6, 2024
cec25ae
Address review suggestions
LakshanWeerasinghe Aug 15, 2024
9e5e907
Address review suggestions
LakshanWeerasinghe Aug 20, 2024
8d08940
Address review suggestions
LakshanWeerasinghe Aug 20, 2024
af93017
Disable output verification for xml-from-record-conversion
LakshanWeerasinghe Aug 20, 2024
04f3a99
Disable output verification for xml-from-record-conversion
LakshanWeerasinghe Aug 20, 2024
167611a
Update lib dependencies
lnash94 Aug 20, 2024
97a067b
Update persist tool and dev tools dependencies
lnash94 Aug 20, 2024
dc14447
Address review suggestions
LakshanWeerasinghe Aug 21, 2024
879b85f
Address review suggestions
LakshanWeerasinghe Aug 21, 2024
d5ef26e
Update the xmldata version
LakshanWeerasinghe Aug 21, 2024
9459738
Bump xmldata version
LakshanWeerasinghe Aug 21, 2024
44dec33
Add u10 licence
LakshanWeerasinghe Aug 21, 2024
e4388f4
Add client invocation tip for SSE server
TharmiganK Aug 21, 2024
6a2f38e
Apply suggestions from code review
TharmiganK Aug 21, 2024
f3f4bf9
Merge pull request #5592 from LakshanWeerasinghe/bump-xmldata-version
LakshanWeerasinghe Aug 21, 2024
aa7d4fd
Merge pull request #5593 from LakshanWeerasinghe/u10-licenece
LakshanWeerasinghe Aug 21, 2024
7a574c6
Merge pull request #5591 from lnash94/u10-libs-version
LakshanWeerasinghe Aug 21, 2024
b042db2
Merge pull request #5594 from ballerina-platform/update-sse-bbe-10-stage
MohamedSabthar Aug 21, 2024
189afcc
Merge pull request #5531 from LakshanWeerasinghe/data.yaml-bbes
LakshanWeerasinghe Aug 21, 2024
70d6048
Update the xmldata version
LakshanWeerasinghe Aug 21, 2024
8d59852
Merge pull request #5590 from LakshanWeerasinghe/data.yaml-bbes-10.x
LakshanWeerasinghe Aug 21, 2024
bab4ef2
Update obeserve module version
LakshanWeerasinghe Aug 21, 2024
8fe25b6
Merge pull request #5597 from LakshanWeerasinghe/u10-licenece
LakshanWeerasinghe Aug 21, 2024
e6d6659
Update c2c version
LakshanWeerasinghe Aug 21, 2024
7fec2b0
Update GraphQL query complexity BBE
DimuthuMadushan Aug 21, 2024
be139f9
Merge pull request #5598 from LakshanWeerasinghe/u10-licenece
LakshanWeerasinghe Aug 21, 2024
1fc42d2
Merge pull request #5599 from DimuthuMadushan/2201.10.0-stage
MohamedSabthar Aug 21, 2024
b3cb085
Merge branch 'master' into 2201.10.0-stage
LakshanWeerasinghe Aug 21, 2024
373cf53
Skip project api tests from release workflow
azinneera Aug 21, 2024
68cb388
Merge pull request #5602 from ballerina-platform/azinneera-patch-1
Dilhasha Aug 21, 2024
1475255
Update update-tool version
LakshanWeerasinghe Aug 22, 2024
9c1d9ff
Merge pull request #5606 from LakshanWeerasinghe/update-tool
keizer619 Aug 22, 2024
d79e4d0
Update gradle.properties
LakshanWeerasinghe Aug 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
481 changes: 481 additions & 0 deletions .github/workflows/daily-build-2201.10.x.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
githubAccessToken: ${{ secrets.GITHUB_TOKEN }}
ballerinaBotWorkflow: $ {{ secrets.BALLERINA_BOT_WORKFLOW }}
run: |
./gradlew build -Pversion=${VERSION}
./gradlew build -x project-api-tests:test -Pversion=${VERSION}
./gradlew release -Prelease.useAutomaticVersion=true -x test
- name: Checkout docker repo
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions ballerina-test-automation/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
swan-lake-latest-version=swan-lake-2201.10.0
swan-lake-latest-spec-version=2024R1
swan-lake-latest-version-display-text=2201.10.0
swan-lake-latest-tool-version=1.4.2
latest-tool-version=1.4.2
swan-lake-latest-tool-version=1.4.3
latest-tool-version=1.4.3
1-x-channel-latest-version=1.2.13
1-x-channel-latest-spec-version=2020R1
430 changes: 226 additions & 204 deletions ballerina/LICENSE

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions examples/anydata-to-yaml-string/anydata_to_yaml_string.bal
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import ballerina/data.yaml;
import ballerina/io;

type ServerConfig record {|
string host;
int port;
DatabaseConfig database;
|};

type DatabaseConfig record {|
string dbName;
string username;
|};

public function main() returns error? {

ServerConfig serverConfig = {
database: {
dbName: "userDB",
username: "testUser"
},
port: 3000,
host: "localhost"
};

// Serialize a Ballerina value to a string in YAML format.
string serverConfigYamlStr = check yaml:toYamlString(serverConfig);
io:println(serverConfigYamlStr);
}
9 changes: 9 additions & 0 deletions examples/anydata-to-yaml-string/anydata_to_yaml_string.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Serialize a Ballerina value to a string in YAML format

The `data.yaml` library provides the `toYamlString` function to serialize a value belonging to `anydata` to a string in YAML format.

For more information on the underlying module, see the [`data.yaml` module](https://lib.ballerina.io/ballerina/data.yaml/latest/).

::: code anydata_to_yaml_string.bal :::

::: out anydata_to_yaml_string.out :::
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
description: This BBE demonstrates how to serialize a value belonging to `anydata` to a string in YAML format.
keywords: ballerina, ballerina by example, BBE, yaml, yaml to string, record to yaml
6 changes: 6 additions & 0 deletions examples/anydata-to-yaml-string/anydata_to_yaml_string.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$ bal run anydata_to_yaml_string.bal
host: localhost
port: 3000
database:
dbName: userDB
username: testUser
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GraphQL service - Query Complexity

a `graphql:Service` can be secured by limiting the complexity of the operations that can be executed. This can be done by setting a maximum complexity threshold for a given service. The query complexity is calculated by assigning a complexity value to each field in the GraphQL schema. The complexity of an operation is the sum of the complexity values of the fields in the operation.
A `graphql:Service` can be secured by limiting the complexity of the operations that can be executed. This can be done by setting a maximum complexity threshold for a given service. The query complexity is calculated by assigning a complexity value to each field in the GraphQL schema. The complexity of an operation is the sum of the complexity values of the fields in the operation.

::: code graphql_service_query_complexity.bal :::

Expand Down
2 changes: 2 additions & 0 deletions examples/http-sse-service/http_sse_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Invoke the service by executing the following cURL command in a new terminal.

::: out http_sse_service.client.out :::

>**Tip:** You can invoke the above service via the [Client server-sent events](/learn/by-example/http-sse-client/) example.

## Related links
- [`http` module - API documentation](https://lib.ballerina.io/ballerina/http/latest/)
- [Resource return types - Specification](/spec/http/#235-return-types)
83 changes: 67 additions & 16 deletions examples/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3837,6 +3837,29 @@
}
]
},
{
"title": "LDAP client",
"column": 3,
"category": "Network libraries",
"samples": [
{
"name": "Add/Remove entries",
"url": "ldap-add-remove-entry",
"verifyBuild": true,
"verifyOutput": false,
"disablePlayground": true,
"isLearnByExample": false
},
{
"name": "Search for an entry",
"url": "ldap-search-entry",
"verifyBuild": true,
"verifyOutput": false,
"disablePlayground": true,
"isLearnByExample": false
}
]
},
{
"title": "JMS service",
"column": 3,
Expand Down Expand Up @@ -4458,6 +4481,21 @@
}
]
},
{
"title": "OS",
"column": 1,
"category": "Common libraries",
"samples": [
{
"name": "Environment variables",
"url": "environment-variables",
"verifyBuild": true,
"verifyOutput": false,
"disableVerificationReason": "Includes varying output",
"isLearnByExample": false
}
]
},
{
"title": "File",
"column": 2,
Expand Down Expand Up @@ -4551,7 +4589,7 @@
},
{
"title": "UUID",
"column": 3,
"column": 2,
"category": "Common libraries",
"samples": [
{
Expand Down Expand Up @@ -4585,21 +4623,6 @@
}
]
},
{
"title": "OS",
"column": 3,
"category": "Common libraries",
"samples": [
{
"name": "Environment variables",
"url": "environment-variables",
"verifyBuild": true,
"verifyOutput": false,
"disableVerificationReason": "Includes varying output",
"isLearnByExample": false
}
]
},
{
"title": "XML data",
"column": 3,
Expand Down Expand Up @@ -4635,6 +4658,34 @@
}
]
},
{
"title": "YAML data",
"column": 3,
"category": "Common libraries",
"samples": [
{
"name": "YAML to anydata",
"url": "yaml-to-anydata",
"verifyBuild": true,
"verifyOutput": true,
"isLearnByExample": true
},
{
"name": "YAML to anydata with projection",
"url": "yaml-to-anydata-with-projection",
"verifyBuild": true,
"verifyOutput": true,
"isLearnByExample": true
},
{
"name": "Serialize to YAML string",
"url": "anydata-to-yaml-string",
"verifyBuild": true,
"verifyOutput": true,
"isLearnByExample": true
}
]
},
{
"title": "Constraint",
"column": 3,
Expand Down
27 changes: 27 additions & 0 deletions examples/ldap-add-remove-entry/ldap_add_remove_entry.bal
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import ballerina/io;
import ballerina/ldap;

public function main() returns error? {
// Initializes a new LDAP client with credentials.
ldap:Client ldapClient = check new (
hostName = "localhost",
port = 389,
domainName = "cn=admin,dc=example,dc=com",
password = "adminpassword"
);

// Creates an `ldap:Entry` record for the new entry.
ldap:Entry addEntry = {
"objectClass": ["top", "person"],
"sn": "user",
"cn": "user"
};

// Adds an entry to the directory server.
ldap:LdapResponse addResponse = check ldapClient->add("cn=user,dc=example,dc=com", addEntry);
io:println("Add Response: ", addResponse.resultCode);

// Deletes an entry from the directory server.
ldap:LdapResponse deleteResponse = check ldapClient->delete("cn=user,dc=example,dc=com");
io:println("Delete Response: ", deleteResponse.resultCode);
}
22 changes: 22 additions & 0 deletions examples/ldap-add-remove-entry/ldap_add_remove_entry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# LDAP client - Add/Remove entries

The `ldap:Client` connects to a directory server and performs various operations on directories. Currently, it supports the generic LDAP operations; `add`, `modify`, `modifyDN`, `compare`, `search`, `searchWithType`, `delete`, and `close`.

The `add` operation creates a new entry in a directory server. It requires a `DN` (Distinguished Name) for the entry and the attributes to be included. The `objectClass` attribute must be specified to define the object classes for the entry, and any attributes required by these object classes should also be included.

The `delete` operation removes an entry from a directory server. It requires a `DN` (Distinguished Name) of the entry to be deleted.

::: code ldap_add_remove_entry.bal :::

## Prerequisites
- Ensure that an LDAP server is up and running locally on port 389 while running the example.

- Run the example by executing the command below.

::: out ldap_add_remove_entry.server.out :::

## Related links
- [`ldap:Client` `add` operation - API documentation](https://central.ballerina.io/ballerina/ldap/latest#Client-add)
- [`ldap:Client` `delete` operation - API documentation](https://central.ballerina.io/ballerina/ldap/latest#Client-delete)
- [`ldap` module - API documentation](https://lib.ballerina.io/ballerina/ldap/latest/)
- [`ldap:Client` - Specification](/spec/ldap/#2-ldap-client)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
description: This example is on how to create/delete entries in a directory server using LDAP in Ballerina.
keywords: ballerina, ballerina by example, bbe, ldap, add
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$ bal run ldap_add_remove_entry.bal
Add Response: SUCCESS
Delete Response: SUCCESS
20 changes: 20 additions & 0 deletions examples/ldap-search-entry/ldap_search_entry.bal
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import ballerina/io;
import ballerina/ldap;

public function main() returns error? {
// Initializes a new LDAP client with credentials.
ldap:Client ldapClient = check new (
hostName = "localhost",
port = 389,
domainName = "cn=admin,dc=example,dc=com",
password = "adminpassword"
);

// Searches for an entry in the directory server.
ldap:SearchResult searchResult = check ldapClient->search(
"cn=user,dc=example,dc=com",
"(sn=user)",
ldap:SUB
);
io:println("Search Response: ", searchResult.resultCode);
}
25 changes: 25 additions & 0 deletions examples/ldap-search-entry/ldap_search_entry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# LDAP client - Seacrh for an entry

The `ldap:Client` connects to a directory server and performs various operations on directories. Currently, it supports the main LDAP operations; `add`, `modify`, `modifyDN`, `compare`, `search`, `searchWithType`, `delete`, and `close`.

The `search` operation is used to retrieve entries that match specified criteria. The components of an LDAP search request include:

- `baseDN`: Defines the base of the subtree for the search.
- `filter`: Specifies the criteria that entries must meet.
- `scope`: Determines extent of the the search coverage within the subtree.

When a directory server processes a valid search request, it finds entries within the defined scope that meet the filter criteria. The matching entries are then returned to the client in a `ldap:SearchResult` record.

::: code ldap_search_entry.bal :::

## Prerequisites
- Ensure that an LDAP server is up and running locally on port 389 while running the example.

- Run the example by executing the command below.

::: out ldap_search_entry.server.out :::

## Related links
- [`ldap:Client` `search` operation - API documentation](https://central.ballerina.io/ballerina/ldap/latest#Client-search)
- [`ldap` module - API documentation](https://lib.ballerina.io/ballerina/ldap/latest/)
- [`ldap:Client` - Specification](/spec/ldap/#2-ldap-client)
2 changes: 2 additions & 0 deletions examples/ldap-search-entry/ldap_search_entry.metatags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
description: This example is on how to search for an entry in a directory server using LDAP in Ballerina.
keywords: ballerina, ballerina by example, bbe, ldap, search
2 changes: 2 additions & 0 deletions examples/ldap-search-entry/ldap_search_entry.server.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$ bal run ldap_search_entry.bal
Search Response: SUCCESS
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type Invoice record {
@xmldata:Namespace {
uri: "http://example1.com"
}

type Item record {
string itemCode;
int count;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import ballerina/data.yaml;
import ballerina/io;

type ServerConfig record {|
string host;
int port;
int[2] remotePorts;
DatabaseConfig database;
|};

type DatabaseConfig record {|
string dbName;
string username;
|};

public function main() returns error? {
// Similar to content read from a YAML file.
string yamlString = string `
host: "localhost"
port: 8080
remotePorts: [9000, 9001, 9002, 9003]
protocol: "http"
database:
dbName: "testdb"
username: "dbuser"
password: "dbpassword"`;

// Based on the expected type, this function selectively constructs the record from the YAML string.
ServerConfig serverConfig = check yaml:parseString(yamlString);
// The `password` field is excluded in the created record value.
// Only the first two elements from the source are used to create the `remotePorts` array.
io:println(serverConfig);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# YAML to anydata conversion with projection

The `data.yaml` library provides multiple APIs to selectively parse elements and attributes from a YAML source, in the form of a string, byte array, or byte block stream, into a Ballerina record. Using projection, users can selectively add fields to records and limit the sizes of arrays.

In this example, the `password` attribute is excluded when creating the `DatabaseConfig` record, and only the first two elements from the source are used to create the `remotePorts` array.

For more information on the underlying module, see the [`data.yaml` module](https://lib.ballerina.io/ballerina/data.yaml/latest/).

::: code yaml_to_anydata_with_projection.bal :::

::: out yaml_to_anydata_with_projection.out :::
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
description: This BBE demonstrates how to selectively convert fields from a YAML source, which can be provided as a string, byte array, or byte block stream, into a Ballerina record with projection.
keywords: ballerina, ballerina by example, BBE, yaml, record, data projection
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$ bal run yaml_to_anydata_with_projection.bal
{"host":"localhost","port":8080,"remotePorts":[9000,9001],"database":{"dbName":"testdb","username":"dbuser"}}
Loading
Loading