The identity executed in transaction function is system admin? - hyperledger-fabric

I start the rest server by multiple user mode .
When I use a participant's business card create a transaction.
In fact the participant doesn't have permission to the resource A,
and in trasaction can update the resource A.
I view the detail of the transaction,It shows
"participantInvoking": "resource:org.hyperledger.composer.system.NetworkAdmin#admin",

Your question is not clear!
Try GET /system/ping to see your current participant and ID.
Also try GET /wallet to see which is the default that you are currently using.
UPDATE
I have just tested the REST api server with this tutorial
I tested with composer v0.19.4. When trying GET /system/ping I see this result:
{
"version": "0.19.4",
"participant": "org.example.trading.Trader#trader1",
"identity": "org.hyperledger.composer.system.Identity#fae5720261eb31a785fe3dcd95f08110148523acfb7c1b75152ca1c0ebcfe989"
}
As far as I can tell it is working OK.
If you have repeatable steps for making it fail I would suggest raising an issue in GutHub.

Related

Authorize.net Error when adding new paymentProfile - code: E00114, Invalid OTS Token

we're trying to add a new customerPaymentProfile for an existing customerProfile. we're patterning our code on the github sample provided
https://github.com/AuthorizeNet/sample-code-node/blob/master/CustomerProfiles/create-customer-payment-profile.js
the only difference is that, we don't pass CC details to our servers. instead, we pass opaqueData from frontend. on Initial customerProfile creation(with a single payment profile) it works w/c is good. but if we try to add a new paymentProfile(using a new opaqueData) we get the error code: E00114, Invalid OTS Token.
the official documentation regarding error code doesn't say much
And it seems like there's a few different cases, where it throws this error code
Using Accept.js
https://community.developer.authorize.net/t5/Integration-and-Testing/E00114-Invalid-OTS-Token/td-p/58879
https://community.developer.authorize.net/t5/Integration-and-Testing/E00114-Invalid-OTS-Token/td-p/59314
Our Case(node.js SDK)
https://community.developer.authorize.net/t5/Integration-and-Testing/Error-while-adding-new-paymentProfile-quot-code-quot-quot-E00114/td-p/69872
Others
https://community.developer.authorize.net/t5/Integration-and-Testing/Intermittent-Invalid-OTS-Token-Errors-E00114/td-p/57509
https://community.developer.authorize.net/t5/Integration-and-Testing/E00114-Invalid-OTS-Token-error-generates-while-creating-ARB/td-p/68685
We also tried to delay the transaction at least 7 seconds, before using the opaqueData maybe to allow their systems to sync as suggested here to receive the same error message.
Anyone ever encountered something like this before?
Any form of help would be highly appreciated.
We were doing something wrong, by doing trial and error(via API) to determine if a customer exists or not. hence hitting api once or twice resulting to an invalid token (error on 2nd call)
So we tried to create a customerProfile, w/ customerPaymentProfile & this will throw error if customerProfile already exist(if its a duplicate email). Whats good here, is that customerProfileId comes with the error payload.
We though of using customerProfileId from error payload, to create a new payment profile for the customer, giving us some edge by reducing one DB call on our system.
The issue with our strategy though, is that opaqueData will expire, when we use it to create customerProfile(w/ payment profile) even though the request failed.
So resolution is to save customer info in our system, and check if it's a returning customer or not. If it is, then get customerProfileId from db, and create new customerPaymentProfile on authorize.net
One could also create customerProfile first, w/o the customerPaymentProfile. if this transaction fails, then at least you haven't used the opaqueData yet and you get the customerProfileId w/o doing any query on your db. So when you try to create a new customerPaymentProfile, you won't get error code E00114 since opaqueData isn't used yet.
lessons learned the hard way for us, but hopefully it helps someone.

What does it mean "Another object with the same value for property proxyAddresses already exists" during licensing an user in Azure AD?

I'm using the Microsoft Graph API versin 1.0 to update a batch of user and for some I receive the following error message:
Another object with the same value for property proxyAddresses already exists.
This happens with some few user, but not with many others.
However I don't understand what it means and how to workaround it.
Any ideas?
Update1:
This my the JSON payload sent with the request:
{
"addLicenses":[
{
"disabledPlans": [
"76846ad7-7776-4c40-a281-a386362dd1b9",
"54fc630f-5a40-48ee-8965-af0503c1386e",
"c68f8d98-5534-41c8-bf36-22fa496fa792",
"8c7d2df8-86f0-4902-b2ed-a0458298f3b3",
"9e700747-8b1d-45e5-ab8d-ef187ceec156",
"c87f142c-d1e9-4363-8630-aaea9c4d9ae5",
"b8afc642-032e-4de5-8c0a-507a7bba7e5d",
"2078e8df-cff6-4290-98cb-5408261a760a"
],
"skuId":"94763226-9b3c-4e75-a931-5c89701abe66"
}],
"removeLicenses":[]
}
Based on the error message, the property proxyAddresses should be unique.
Please make sure you don't configure the same proxyAddresses for multiple users when updating users.
In theory, this property cannot be updated through the Microsoft Graph API. So if you didn't put proxyAddresses in the body, please share the requests of the updated users which have this issue.
this may be old, I encountered a similar issue. I am doing a graph api call which indirectly updates some of user attributes, so getting this error. The tenant admin should check for duplicate records and remove or update them, they can follow this link

How to get Correct Subscription key for microsoft Face API for Nodejs?

I am using project-oxford inorder to use Microsoft API with nodejs. I am keep on getting error that ,
{"code":"Unspecified","message":"Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key."}
{"code":"Unspecified","message":"Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key."}
I have also regenerated my subscription key for my microsoft account and tried to access the code. Still I am getting the same issue. Spent lot of time to find my bug fixed, But I couldn't able to solve.
This is my nodejs code,
var oxford = require('project-oxford'),
client = new oxford.Client({SubscriptionKey});
client.video.trackFace({
url: path,
}).then(function (response) {
console.log('Response ' + JSON.stringify(response));
},function (error) {
console.log("Error"+JSON.stringify(error));
});
Please guide me to fix this issue.Thanks in Advance!!
You can obtain a key via the Microsoft Cognitive Services web site.
From what I can gather, you are using https://github.com/felixrieseberg/project-oxford, is that correct?
It seems that project requires one subscription key, which then is used for all API calls. I can't see any reasons it shouldn't work, if you have signed up for the subscription key for the Video API.
Given that the library you're using is built the way it is, it seems to me that you will only be able to use one API at the time, doing it the way you're doing it now.
Am I making any sense?
Actually Now I am getting output for the same code excepting that I was not able use the localhost URL [i.e., http://localhost:3000/uploads/img.jpg]. While using the url of webserver only then I am getting the output!!
Can anyone explain me the complete fact. i.e., I need to know whether I cannot use the localhost url. If I use so I am getting the error which I have posted in this question.

Get id or name of Azure Webjob run when triggered externally

when I start a webjob using the rest api :
/api/triggeredwebjobs/{job name}/run?arguments={arguments}
I need to know if the program invoked ran successfully or not and for now I request the latest result from the history using .../api/triggeredwebjobs/{job name}/history
Now, is there a way to get the {id} of the Job just after I invoke ? Because obviously there's no way to be sure that the latest history is the job I just ran. Or is there another way to get things done?
Thanks.
Yes, we added a new binder in the extensions library to allow you to get the instance ID - ExecutionContext. See an example here in the extensions repo samples. To use this binding you'll have to pull in the beta1 Microsoft.Azure.WebJobs.Extensions prerelease package, and add config.UseCore() to your startup code (as the sample app shows). This was added based on another ask similar to yours.
You can call this anywhere in your code and it works !
(Not in debug, but when published)
Console.Out.WriteLine("RUN NAME : " + Environment.GetEnvironmentVariable("WEBJOBS_RUN_ID"));
We just added support for this in the WebJobs API. The way it works is that when you send the POST request to trigger the WebJob, you now get back a location attribute, with a URL to the details of the run that was started. e.g.
Location: https://mysite.scm.azurewebsites.net/api/triggeredwebjobs/SomeJob/history/201605192149381933
You can then query this URL to track the run, e.g.
{
"id": "201605192149381933",
"name": "201605192149381933",
"status": "Success",
"start_time": "2016-05-19T21:49:38.1933956Z",
"end_time": "2016-05-19T21:49:39.4826458Z",
"duration": "00:00:01.2892502",
"output_url": "https://mysite.scm.azurewebsites.net/vfs/data/jobs/triggered/SomeJob/201605192149381933/output_log.txt",
"error_url": null,
"url": "https://mysite.scm.azurewebsites.net/api/triggeredwebjobs/SomeJob/history/201605192149381933",
"job_name": "SomeJob",
"trigger": "External - ARMClient/1.1.1.0"
}

Setting up user_ctx field on CouchDB Replicator

"user_ctx": {
"name": "adminuser",
"role": "[\"_admin\"]"
},
"_replication_state": "error",
"_replication_state_time": "2011-08-30T15:09:03+00:00",
"_replication_id": "08fd9d6dcc5a0882fc9fd0d971b05938"
}
For some reason, I can't get my replicator to work. The log continues to show "unauthorized to access database", referring to my localhost. I know I need to have user_ctx set, but for some reason it just doesn't like to work. I copied the info out of my source. I even created new admin users to try and fix the problem, none worked. Do I need to specify more roles for the user?
The other has a good resource https://gist.github.com/832610, but the user_ctx he set's in the example isn't the admin user, the appear to just be random roles.
Anyone have any experience with the CouchDB replicating to the localhost?
If you create the document as the server admin, then you do not need this field. I think omitting it completely will work.
If you create the document as a normal user, then it should match your name and roles which you can get by querying /_session. In fact, I think you can copy the userCtx field from the session response directly into the user_ctx field of the replication document.
Found out what I did thanks to the CouchDB Apache Mailing Lists. Should have had "roles" instead of "role".

Resources