How to inject MetaMask Provider in Chrome Sandbox Environment? - metamask

I am building a chrome extension on manifest v3, since it doesn't allow unsafe-eval scripts i had to move some of my code into a sandbox environment. The extension relies on web3 libraries and MetaMask as the Provider but i couldn't get the provider into the sandbox.
Is there any workaround for this?

Related

How to connect a Go client application to the IBM VS Code Fabric Extension?

I am working on some projects with Hyperledger Fabric, currently using the IBM VS Code Extension. The chaincode is written in Go, as is the client application which provides a RESTful API, using the Go Fabric SDK. However, I am having trouble connecting the client application to the chaincode. Most of the tutorials and examples I have seen use Node.js as the client and it seems the Node SDK needs less configuration.
As far as I understand it, the steps should be similar to the following but more detailed information seems to be a little bit lacking when it comes to the Golang Fabric SDK.
The client application needs the following information to be able to communicate with the blockchain network:
The enroll ID and secret of the application identity (used to generate a cert and private key), or the certificate and private key directly
The connection profile
The smart contract name
The name of the channel the smart contract was instantiated on
Use the certificate and private key of the application identity, along with CA endpoint information inside your connection profile
In the VSCode plugin
Register an 'application' identity in the 'Fabric Wallets' section
Export the connection profile from the 'Fabric Gateway' section
Export the application identity's wallet
Update code to point to the exported connection profile
Update code to point to the exported wallet
As far as I can tell, the connection profile and other steps needed to connect the SDK to the VS Code Network should be pretty 'standard' so I wonder if someone knows of a working example?
Thanks for the collective help!
Unfortunately you are going to struggle with this at the moment. Wallets are not compatible with the Go SDK currently. Also the Go SDK doesn't quite conform (or at least it didn't the last time I tried it) to the connection profile specification so the connection profile from the VS Code extension won't work without some minor modification and didn't work with a CA not using TLS (IIRC I patched the Go SDK to make it work).
There is work underway to bring the Gateway/Wallet programming model to the Go SDK which will then make working with the VS Code extension a lot easier, but I don't know when a version of the Go SDK with a working implementation will be available.

Can add-on providers access the code of my application in Heroku without my permission?

Can add-on providers see/access the code of my application in Heroku without my permission?
No, the addons API has only a limited subset of Heroku API endpoints it can access. None of those endpoints will give them your source code, and the addons don't run directly on your dynos.
It depends on the Heroku add-on implementation and if the add-on is using the Heroku Platform API that would allow you to access your source code.
I found in Heroku Partner API a Source endpoint that allows you to download source code so it might be possible to download your app code.
https://devcenter.heroku.com/articles/platform-api-reference#source
I've created my own Heroku add-on https://elements.heroku.com/addons/knapsack-pro and from the add-on creator perspective, I can tell that I did not find any requirements or access levels for Heroku API so I believe any add-on provider could use Heroku Source API to access your code.

Windows app certification issue in UWP (Universal windows platform)

I have a winJS project that uses windows runtime component, for this I have enabled WinRT Access to all.
My app works fine on public network.
My client uses some type of private network and my app did not have permission for private network access.
For fixing this I enabled Private Networks (Client & Server) in Capabilities in package.appxmanifest file.
Now the app works fine in private networks too.
But then I had to put this app to windows store and when I carry out the windows certification kit test it fails with the following error:
FAILED App manifest Error Found: The app manifest test detected the
following errors: The Application cannot include an
ApplicationContentUriRule with 'all' or 'allowForWebOnly'
WindowsRuntimeAccess while any of the following capabilities are
enabled: enterpriseAuthentication, sharedUserCertificates,
musicLibrary, picturesLibrary, videosLibrary, removableStorage,
documentLibrary, internetClientServer, privateNetworkClientServer.
Can anyone provide me some workaround ?
Thanks!
As per my knowledge and research, if you define 'ApplicationContentUriRule' with runtime access of 'ALL', the app fails while validating to windows store. This is because Microsoft considers that kind of configuration as a security risk.
Please refer this https://social.msdn.microsoft.com/Forums/en-US/fd28bcd5-b3a8-4307-be93-29fc4c5aaacd/uwpwork-around-for-application-content-uri-rule-windows-runtime-access?forum=wpdevelop , I think this will help you as well.

Create azure VM with non interactive login CLI

I'm working on deployment of multiple VMs' on Azure platform. I'm having problem authenticating without web interactive Login. I'm going through authentication using service-principal. However as soon as i try to run a 'azure vm list' for instance, I get a message: The server failed to authenticate.
P.S. I could create VM using interactive login. However this way does not work for the automated deployment. I'm the owner, admin of the Trial azure subscription.
I am guessing, you are using ASM instead of ARM. Unfortunately, for Azure CLI, service principal only work for ARM. See this issue in GitHub.
Luckily, there is an alternative for this. you can use azure account download or click https://manage.windowsazure.com/publishsettings to download a publish settings profile. And then, use azure account import <the file name> to login.
Notice that similar to service principal, publish settings profile only work for ASM. Microsoft Azure encourages you to use ARM instead of ASM, hence I suggest you to switch to ARM. Service Principal is Role-Based Access Control. That provides extra security. And, ASM is retiring, which means new service will only available in ARM.

Debugging Azure Mobile Service Authentication

I'm new to azure mobile services development and any help will be greatly appreciated.
I have created sample mobile service application and could successfully launch and debug it locally. As a next step I've added google authentication. Everything works fine when the service is Published and running in the cloud. But, I could not make the service to run locally so that I can debug the service for cases when the user is authenticated.
So for I have wrestled with IIS Express and made it work with HTTPS on port 44300. But Google authentication services complained because of redirect URLs mismatch, even though I've added https://localhost:44300/signin-google to redirect list.
I feel like I'm not doing something correct here. Something does not make me believe that debugging locally is not possible.
Thanks,
Ruben
Is possible to debug in localhost, but the google/facebook/Microsoft authentication should not be tested, because it is provided out-of-the-box by Azure Mobile Service team.
you should configure it in Azure Portal and then you should implement it in your application like documentation provides.
The following resources has the references to the Authentication articles:
Azure Mobile Services for Client Apps

Resources