Skip to content

Commit

Permalink
Apply changes to adhere code conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuvindu committed Oct 4, 2023
1 parent b1e8339 commit 984abe6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions ballerina/modules/wssec/document.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import ballerina/jballerina.java;

class Document {

private handle nativeDocumentBuilder;

public function init(xml xmlPayload) returns Error? {
Expand Down
1 change: 1 addition & 0 deletions ballerina/modules/wssec/sec_header.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import ballerina/jballerina.java;

class WSSecurityHeader {

private handle nativeSecHeader;

function init(Document document) returns Error? {
Expand Down
1 change: 1 addition & 0 deletions ballerina/modules/wssec/signature.bal
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import ballerina/crypto;
import ballerina/jballerina.java;

class Signature {

private handle nativeSignature;

function init() returns Error? {
Expand Down
3 changes: 2 additions & 1 deletion ballerina/modules/wssec/tests/test_utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

const string USERNAME = "username";
Expand All @@ -38,6 +37,7 @@ function assertTimestampToken(string envelopeString) {
test:assertTrue(envelopeString.includesMatch(created));
test:assertTrue(envelopeString.includesMatch(expires));
}

function assertUsernameToken(string envelopeString, PasswordType passwordType) {
string:RegExp usernameTokenTag = re `<wsse:UsernameToken .*>.*</wsse:UsernameToken>`;
string:RegExp usernameTag = re `<wsse:Username>${USERNAME}</wsse:Username>`;
Expand All @@ -64,6 +64,7 @@ function assertUsernameToken(string envelopeString, PasswordType passwordType) {
}
}
}

function assertSignatureWithX509(string securedEnvelope) {
string:RegExp keyIdentifier = re `<wsse:KeyIdentifier EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3">.*</wsse:KeyIdentifier>`;
test:assertTrue(securedEnvelope.includesMatch(keyIdentifier));
Expand Down

0 comments on commit 984abe6

Please sign in to comment.