Composer Playground Profiles? - hyperledger

When you use Playground tied to a Connection Profile of your Fabric, meaning running Playground Locally, you're able to deploy your own chaincode, and issue identities. Since you do so as PeerAdmin, and you can manage your wallet with different identities, are those identities Local? If I check the Playground from another device, I have the same wallet there, with PeerAdmin rights.
So, is it possible to run playground with the same chaincode in different devices but with different roles, identities or wallets? In a similar fashion as how it is when you use the RestAPI with OAuth, where you can establish each participant as an identity, using the same API "address".
I guess it maybe possible to run a local instance of playground in another device and establish the connection profile to the remote one and then it would have a different wallet?

Playground uses a local credential store, by default stored in the user's home directory, which may be on the host, or inside a Docker container, depending how you are running Playground.
We are working on designs for how credentials can be imported/exported from Playground at the moment. You can follow progress here:
https://github.com/hyperledger/composer/issues/902

Related

AzureDevOps iOS build fastlane use Apple API Key

I've created an Azure DevOps pipeline for building a React Native mobile application for iOS. I have a service connection to Apple's App Store Connect and it uploads the build to TestFlight as expected. I am also passing Release Notes to the AppStoreRelease task and this requires FastLane credentials to get around the Two Factor Authentication.
I tried the approach of creating a fastlane session ID locally and putting that onto the service connection as per https://github.com/fastlane/fastlane/blob/master/spaceship/README.md#support-for-ci-machines. This approach works fine but the session times out and it has to be done again which isn't a sustainable approach.
I've seen documentation on using App Store Connect keys to authenticate (https://docs.fastlane.tools/app-store-connect-api/), but haven't seen any documentation on how to do this for Azure DevOps. Has anyone done this and can provide documentation or a point in the right direction.

Enabling Authentication for Access to Hyperledger Composer Playground and Blockchain Explorer

Is there anyway to secure the access for Local Hyperledger Composer Playground and Blockchain Explorer just like the REST Server authentication?
The Local Composer Playground 'sees' all the cards you have on the local file system, and a user hitting that Playground can choose which card to use. So for testing it is easy to switch between them.
You can Export a Card from Playground and send it/pass it to another person. If they use the CLI to import the card, and start Playground they will only see that card. In this way you can achieve authentication for Playground users but it is different to the REST server.
Note: that the REST server is intended to be a key element of the infrastructure for a live production system, whereas the Playground is intended for Modelling, Testing and Development - not for serious production deployment.

Transparency in Hyperledger Fabric

I'm aware that hyperledger is suitable for businesses who care about their data confidentiality. But, I'd like to use it for the cases where data transparency matters too.
Questions: In hyperledger fabric, can we set our blockchain in a way that public can read it, but only certificate holders can write (or send transaction) to it?
Yes. I just created a registered guest account. It still uses certs and the chaincode controls access. Set to read only for GUEST. Technically a query is a transaction. You could have the web app just login as guest when the page loads.
BPN Dev Network Org 1
BPN Dev Network Org 2

Manage Hyperledger Composer wallet

I have been trying to connect my Hyperledger composer to my bluemix instance with no visible result. in the process I accidentally did rewrite my admin account with a different password.
Since there is no visual way seemingly to control the users in the wallet my question is: is there any way to manager the users inside a hyperledger composer wallet?
There is currently no way to visually manage wallets in the playground, other than to issue or add new identities.
The playground just uses local storage for identities in your wallet at the moment so, if it starts causing problems, you could try using a private browser window. (A different browser or entering localstorage.clear() in the browser console should also give you an empty wallet).
There are some ideas around for expanding identity management in the future. Have a look at issue 817 in the hyperledger composer repository if you're interested in finding out more.

Using OAuth for both development and production environments

I have seen other questions on SO about this (here, here, and here), but I am not satisfied with any of the solutions, so I am asking it again. I am starting a web application that will utilize OAuth from multiple providers (Google, Facebook, Twitter, Yahoo) for authentication. I am struggling to find a configuration suitable to use for both a local development environment and a production environment.
The leading solutions I've found are to register multiple apps within each provider, receiving a different consumer key and secret for each:
"My App Production" - with a callback URI to http://www.myapp.com/callback
"My App Development" - with a callback URI to http://local.myapp.com/callback
Add an entry to your local hosts file to point local.myapp.com to 127.0.0.1 and some configuration for your application to use the proper consumer keys based on the environment, and you are good to go, right?
But my application is responsive and I need to test my development environment running on my PC from multiple other devices, like my iPhone and iPad, neither of which will be able to resolve the development callback URI.
Let's say I already have a DNS server on my network and am able to add the entry for local.myapp.com there instead of my local hosts file and can now access my development instance from any device on the network.
But my development team all operates on the same local network. Now local.myapp.com points to the same IP for everyone. Let's go back to setting the hosts file on each developer's computer so that they can all work independently from within their workstation. Now no one can test their development instance from their iPhone again. It hardly seems like the right answer for each developer to register an application with the provider just so they can specify a unique callback URI.
Normally when I get way down in the weeds with a complicated solution for a seemingly straightforward issue, it usually means I'm doing something fundamentally wrong. Am I missing something about OAuth, is it not intended to be used like this? I am tempted to scrap OAuth altogether and just go with OpenID (no app registration required and can specify the callback URI from within the app), but then I lose two of the big hitters in Facebook and Twitter. I don't really need any of the user's data, it's just a nice to have if it's available. Can someone talk me back into OAuth?
I can't speak for FB or Twitter, but in Google's Oauth implementation you can register several oauth callback URLs. So you simply need some logic in your app which senses that it is in test mode, and then starts the Oauth flow with the appropriate callback URL. There are downsides, eg clashes between the live and the test refresh tokens, but they are manageable.
In my app I have a singleton which manages all of this. When my app needs to start an Oauth flow it calls the singleton with the request URL and any other salient data (eg. debug flag) and the singleton returns the correct callback URL, client ID etc.
I posted the following answer about a rails app I wrote:
OAuth2 in development and production
It was a gem called figaro which did per env configs for google OAuth2.
I have yet to find a less manual approach that enables dev access to all concerned devices:
Assign each developer's machine a fixed IP through the local network's DHCP system based on their MAC address, or (less recommended) have them choose an IP and hope for the best
(optional*) Assign each developer's machine a DNS hostname in the local network based on that IP
Register an oauth entry for developer on each provider with the hostname of the developer's machine.
Each developer configures their application to use their unique oauth dev tokens.
Assuming all the devices in the network rely on the same DHCP and DNS servers you'll then be able to visit alice.dev.myapp.com or bob.dev.myapp.com from any device on the network.
Note, you'd manage the oauth configuration for each an every other environment separately, but following the same approach.
There are likely tools to automate registering a developer's machine IP and hostname to ease that part of the puzzle. Registering the oauth config on each provider per dev is the most tedious step.
UPDATE
*You can skip the DNS part if you use a xip.io url e.g. 10.0.0.123.xip.io if you know Alice is 10.0.0.123, but you'd still want that IP to be fixed as you don't want to keep updating the url for the oauth tokens in step 4.

Resources