Error in fetching updates for ballerina central packages - wso2

I am using wso2/soap package from ballerina central to create a simple soap connector.
import wso2/soap;
import ballerina/io;
endpoint soap:Client soapClient {
clientConfig:{
url: "http://localhost:9000"
}
};
function main (string... args) {
xml body = xml `<m0:getQuote xmlns:m0="http://services.samples">
<m0:request>
<m0:symbol>WSO2</m0:symbol>
</m0:request>
</m0:getQuote>`;
soap:SoapRequest soapRequest = {
soapAction: "urn:getQuote",
payload: body
};
var details = soapClient->
sendReceive("/services/SimpleStockQuoteService",soapRequest);
match details {
soap:SoapResponse soapResponse => io:println(soapResponse);
soap:SoapError soapError => io:println(soapError);
}
}
This code was initially building and running successfully with ballerina-0.975.0 version. Recently I have installed ballerina-0.980.0. After this I get the following error when trying to build the code.
Compiling source
package:0.0.0
ballerina: format error: ballerina: unsupported program file version 18
This occurs as I am trying to build using 0.980.0 and old the wso2/soap package is used from the home repository. Normal logic is, we check for the package in the home folder and if not found then we fetch from the ballerina central repository. This logic fails in this scenario as we are using a newer ballerina version. Newer ballerina version tries to use the existing soap package downloaded in the home folder and throws an error. Instead we should fetch the newer version of soap package from the ballerina central.

The issue will be fixed in future releases. For the time being, you can pull the latest version of the connector (which is compatible with Ballerina 0.980.0) using the following command and resolve the issue.
ballerina pull wso2/soap

Related

New bundled expo-cli start is returning a manifest that cannot be parsed by expo-dev-launcher

We are currently going through the upgrade to expo SDK 47, following these instructions:
https://blog.expo.dev/expo-sdk-47-a0f6f5c038af
Part of the upgrade involves the recommended switch to using the bundled expo-cli, rather than the global instance.
When we make this change, and run npx expo start --dev-client, our android app throws an error when selecting the dev server, with the message:
Value ----------------------------224819657222108214122421 of type java.lang.String cannot be converted to JSONObject
When I hit the dev server url (eg. http://192.168.0.146:8081/?platform=android) manually to obtain the manifest, I can see it is indeed starting with the above value, as it contains some meta-data, eg.
----------------------------224819657222108214122421
Content-Disposition: form-data; name="manifest"
Content-Type: application/json
{"id":"f5c3b7be-999c-436e-b9c4-b453cf873af0","createdAt":"2023-01-12T10:13:41.499Z","runtimeVersion":"1.e","launchAsset":{"key":"bundle","contentType":"application/javascript","url":"http://10.20.0.174:8081/index.bundle?platform=android&dev=true&hot=false"},"asset
...
When I switch back to using the globally installed CLI as per the instructions in the upgrade blog, so changing the start command from npx expo start to expo-cli start, the same test results in the manifest being returned without the supplementary data, and the app can be loaded successfully.

How to fix build error because Install pods using EAS build EXPO?

I'm trying to build an IOS app using EAS service expo, but when I try to build, there is an error while install pods on build details expo. And this is the error.
Unable to find a specification for `UMTaskManagerInterface` depended upon by `EXLocation`
I try to install pod by npm i pod-install but still get error. Is this because I build on Windows, or what should I do to fix this error? I also try to find the error in GitHub forum, and it's say adding path pod in ios/Podfile which I can't find it in my expo project. Where is ios/Podfile file located in expo project?
This is the full error
Installing pods
Using Expo modules
Auto-linking React Native modules for target `MMS`: RNCAsyncStorage, RNCCheckbox, RNDateTimePicker, RNGestureHandler, RNPermissions, RNReanimated, RNScreens, react-native-safe-area-context, and react-native-viewpager
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
CocoaPods 1.11.2 is available.
To update use: `sudo gem install cocoapods`
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.11.2
[!] Unable to find a specification for `UMTaskManagerInterface` depended upon by `EXLocation`
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
[stderr] [!] `<PBXResourcesBuildPhase UUID=`13B07F8E1A680F5B00A75B9A`>` attempted to initialize an object with an unknown UUID. `2EE81B3C866A4A13B6460929` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
pod exited with non-zero code: 1
Edit*
i try using expo build:ios-> archive is working perfectly. why using eas build -p ios i got that error?

How to use a non-JDBC connector in a custom Policy Information Point (PIP)

I want my custom Policy Information Point (PIP) to be able to connect to OpenStack Swift (an Object Storage application) thanks to this connector. The connector is able to retrieve metadata from an object, which would be sent back to the Policy Decision Point (PDP) when the right AttributeId is requested.
In our context, Swift holds information about our resources (objects here).
Below are all the steps I followed to try and use this connector in my custom PIP.
I got the connector to work locally (no integration with WSO2IS yet) following only the first 3 steps and calling the swift_test function in a debug-purposed main class.
I followed this guide to implement a custom PIP, which suggests using a database offering a JDBC driver (such as mariadb). My issue is that Swift does not offer a JDBC driver, hence the use of the openstack4j connector.
I added the needed openstack4j dependency to the maven project linked in the guide (here).
I also added the following imports to the extended class (named KMarketJDBCAttributeFinder in the guide):
package org.xacmlinfo.xacml.pip.jdbc;
import org.openstack4j.api.OSClient.OSClientV3;
import org.openstack4j.model.common.Identifier;
import org.openstack4j.model.storage.object.SwiftAccount;
import org.openstack4j.model.storage.object.SwiftContainer;
import org.openstack4j.model.storage.object.SwiftObject;
import org.openstack4j.model.storage.object.options.ObjectListOptions;
import org.openstack4j.openstack.OSFactory;
import org.wso2.carbon.identity.entitlement.pip.AbstractPIPAttributeFinder;
...
and this function to test and retrieve an object's metadata:
public void swift_test() {
OSClientV3 os = OSFactory.builderV3()
.endpoint(our_keystoneV3_url)
.credentials(our_keystone_username, password, domain_identifier)
.scopeToProject(Identifier.byName(our_tenant), Identifier.byName(our_domain))
.authenticate();
SwiftAccount account = os.objectStorage.account().get();
Map<String, String> md =
os.objectStorage.objects().getMetadata("our_container", "our_object");
System.out.println(md.toString());
}
which I call in the overriden getAttributeValues of the custom PIP class.
I then built the class using mvn package to generate the .jar which I copied in <IS_HOME>/repository/components/lib.
I downloaded all my dependencies using mvn dependency:copy-dependencies, and copied them all to the same <IS_HOME>/repository/components/lib folder.
I start the wso2is server, send a XACML request which involves calling my custom PIP, and see the following error in <IS_HOME>/repository/logs/wso2carbon.log:
ERROR {org.openstack4j.core.transport.internal.HttpExecutor} - No OpenStack4j connector found in classpath
ERROR {org.wso2.carbon.identity.entitlement.pip.CarbonAttributeFinder} - Error while retrieving attribute values from PIP attribute finder: org.openstack4j.api.exceptions.ConnectorNotFoundException: No OpenStack4j connector found in classpath
ERROR {org.wso2.balana.finder.AttributeFinder} - Error while trying to resolve values: Error while retrieving attribute values from PIP attribute finder: No OpenStack4j connector found in classpath
Our wso2is server, version 5.7.0 runs on a CentOS 7.6 VM.
My question is then: can we use this kind of connector in a custom PIP with wso2is? If so, how would I go about resolving the classpath issues between my dependencies?
P.S. : I previously added another custom PIP, connecting this time to a MariaDB database which is working well. The .jar I create when using mvn package contains both custom PIPs, and they are both recognized in the section "PDP > Extension" in the wso2is web interface.
Here is the list of dependencies obtained with the mvn command:
activation-1.1.1.jar
btf-1.2.jar
classworlds-1.1-alpha-2.jar
commons-codec-1.9.jar
commons-io-2.3.jar
commons-lang-2.6.jar
commons-logging-1.2.jar
guava-20.0.jar
httpclient-4.5.3.jar
httpcore-4.4.6.jar
jackson-annotations-2.7.0.jar
jackson-core-2.7.3.jar
jackson-core-asl-1.9.7.jar
jackson-coreutils-1.6.jar
jackson-databind-2.7.3.jar
jackson-dataformat-yaml-2.7.3.jar
jackson-jaxrs-base-2.7.3.jar
jackson-jaxrs-json-provider-2.7.3.jar
jackson-mapper-asl-1.9.7.jar
jackson-module-jaxb-annotations-2.7.3.jar
jboss-annotations-api_1.2_spec-1.0.0.Final.jar
jboss-jaxrs-api_2.0_spec-1.0.1.Beta1.jar
jboss-logging-3.3.0.Final.jar
jcip-annotations-1.0.jar
jcl-over-slf4j-1.7.2.jar
jdom2-2.0.6.jar
joss-0.10.2.jar
json-patch-1.9.jar
jsr305-2.0.0.jar
junit-3.8.1.jar
maven-artifact-2.0.jar
maven-compiler-plugin-2.0.jar
maven-plugin-api-2.0.jar
msg-simple-1.1.jar
openstack4j-3.1.0.jar
openstack4j-core-3.1.0.jar
openstack4j-resteasy-3.1.0.jar
org.wso2.carbon.identity.entitlement-4.2.0.jar
plexus-compiler-api-1.5.1.jar
plexus-compiler-javac-1.5.1.jar
plexus-compiler-manager-1.5.1.jar
plexus-container-default-1.0-alpha-8.jar
plexus-utils-1.0.4.jar
resteasy-client-3.1.4.Final.jar
resteasy-jaxrs-3.1.4.Final.jar
resteasy-jaxrs-services-3.1.4.Final.jar
slf4j-api-1.7.2.jar
snakeyaml-1.15.jar

Error getting token from STS

I am getting an error from the following method call in WSO2 identity server STS client call,
the call :
responseToken = stsClient.requestSecurityToken(servicePolicy,
STS_EPR, stsPolicy, RELYING_PARTY_SERVICE_EPR);
returns the following error.
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init()V
at org.apache.ws.security.WSSConfig.staticInit(WSSConfig.java:311)
at org.apache.ws.security.WSSConfig.<init>(WSSConfig.java:327)
at org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:336)
at org.apache.ws.security.WSSConfig.getDefaultWSConfig(WSSConfig.java:345)
at org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:363)
at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:61)
at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)
at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:426)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:398)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
at org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java:164)
at org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java:181)
This is obviously a wrong jar being included in the classpath. I am running this against WSO2 identity server 4.1.0 and offending wss4j .jar version is wss4j_1.5.11.wso2v5.jar which comes with 4.1.0 IS. Which version of .jar should I used to get rid of this issue?
Side Note: I looked for source .jar files in the public Maven Repository of WSO2, but only binary .jar files are available there, why source .jar files are missing in the WSO2 public repository as WSO2 believes in open source software?
Here I am referring specifically to http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/ws/security/wss4j/1.5.11-wso2v5/
Go to identity servers bin folder [wso2is-4.1.0/bin] and issue the command "ant" to get the required libraries, (make sure you have installed Apache Ant)
wso2is-4.1.0/bin$ ant
and then after building the ant script, go to the location wso2is-4.1.0/repository/lib and see the required libraries.
rampart-policy_1.6.1-wso2v8.jar
rampart-core_1.6.1-wso2v8.jar
rampart-trust_1.6.1-wso2v8.jar
wss4j_1.5.11-wso2v5.jar
axis2_1.6.1-wso2v8.jar
axiom_1.2.11-wso2v3.jar
make sure you use above versions in your class path of the client.

AWS PHP SDK with Composer - missing sdk.class.php

Environment: MAC - Mountain Lion
I am trying to use the AWS PHP SDK for a project. I followed the Amazon web site's SDK installation directions (through composer) -- using the following Link to AWS
I created the file compser.json. Contens:
{
"require": {
"aws/aws-sdk-php": "2.*"
}
}
From the command line, I typed:
curl -s "http://getcomposer.org/installer" | php
Then
php composer.phar install
A new directory appeared "vendor" and inside it, the AWS SDK 2 was automatically installed.
The problem is that I am expecting (per the code example I'm trying to follow), I am expecting to see the following file:
vendor/aws/aws-sdk-for-php/sdk.class.php
But it's not there. Could this be referencing an older version of the SDK?
The automatically generated by the "php composer.phar install" command: vendor/autoload.php looks like this:
<?php
// autoload.php generated by Composer
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit25a7292f83dd9a43a459f6c2e51befba::getLoader();
Is it possible that the file: sdk.class.php is valid for version 1 of the SDK, but not version 2?
Entirely correct. sdk.class.php is a file that exists in SDK 1.x, but not 2.x.
The correct instructions are in the SDK2 README.