libkv / ectd go client : how to use config.TLS object? - coreos

Trying to use docker/libkv
https://github.com/docker/libkv#tls
which specifies that etcd and consul support TLS using a config.TLS object
I'm trying to figure the format of this object.
The etcd go client that libkv uses is here:
https://github.com/coreos/etcd/tree/master/client
but there is no doc about this feature and the code itself has barely any reference to TLS
So my question is 2 parts:
Does anyone know if indeed the coreos/etcd client supports TLS? (I believe it must since docker/libkv uses it and claims to support it, but I'm having some doubts here)
Does anyone have an example of the config.TLS object format?
Thanks for your input
PS: I did ask the question there, but figured I'll post here too.

etcd does support TLS configuration. You can find the documentation for this here: https://coreos.com/etcd/docs/latest/security.html
You can find example code for doing this here: https://github.com/coreos/etcd/blob/master/etcdctl/command/util.go#L252
In particular look for the gettransport function call that sets up the transport with TLS.

Related

create space/room and send message via google-api in node.js

Case: Google Chat support in node.js using the googleapis library.
I studied the documentation, created a service account and implemented authentication. In first step I used the chat.spaces.list() method and it worked (no error returned).
I want to send a message via chat, so I wanted to create a new space, I found the chat.spaces.create method (https://developers.google.com/chat/api/reference/rest/v1/spaces/create) Unfortunately, this method is not present in "googleapis" for node.js In general, I see that the list of methods in "googleapis" is different than the one in the documentation. Only spaces in the documentation, but spaces and rooms in the library... I'm lost. How to do it? Any tips?
I see that the list of methods in "googleapis" is different than the one in the documentation
I think you are seeing wrong documentation. Your reference link is REST API documentation. The nodejs googleapis client documentation you can see on https://googleapis.dev/nodejs/googleapis/latest/chat/classes/Resource$Spaces.html.
And also based on the REST API documentation, the API that you looking for(create space) is not general available.
† Supports user authentication in Developer Preview. App authentication isn't available.
You need to join Google Workspace Developer Preview Program to access that feature.

What is the difference between StripeAPI.defaultPublishableKey and STPAPIClient.shared.publishableKey?

I know this might seem like a simple question but I haven't found any answers in the documentation. Can someone please explain the difference between StripeAPI.defaultPublishableKey and STPAPIClient.shared.publishableKey. When are they used and for what specifically?
I'm new to coding so any help is appreciated! :)
StripeAPI is the top-level class that imports the rest of the Stripe iOS SDK. The documentation explains the defaultPublishableKey property on StripeAPI:
Set this to your Stripe publishable API key, obtained from https://dashboard.stripe.com/apikeys. Set this as early as possible in your application’s lifecycle, preferably in your AppDelegate or SceneDelegate. New instances of STPAPIClient will be initialized with this value. #warning Make sure not to ship your test API keys to the App Store! This will log a warning if you use your test key in a release build.
STPAPIClient, on the other hand, is the class/singleton you use to make Stripe API requests. The shared property on this class is the singleton, and the publishableKey property on that singleton defaults to the value of StripeAPI.defaultPublishableKey. You can, however, change it if you need to make a request with a different key, although doing so would be an uncommon edge case.
You can read more about STPAPIClient, including the properties mentioned above in Stripe's documentation.

Integrating Optimizely with Adobe Analytics

I'm trying to Integrating Optimizely with Adobe Analytics. I have followed along with this guide: https://help.optimizely.com/Integrate_Other_Platforms/Integrating_Optimizely_with_Adobe_Analytics with no success.
The props(prop51) and evars(eVar51) that i'm choosing via the experiment integrations in Optimizely are never sent. I check via the wasp chrome add-on and via the Adobe account.
All other data (props & eVars) that we set manually are sent.
We are not using s_code.js but AppMeasurement.js version: 1.5.1. I don't know if we are using custom s variable. I guess not. So I have follow the guide and used:
window.optimizely.push("activateSiteCatalyst"); with no success.
I have also tried: window.optimizely.push(['activateSiteCatalyst', {"sVariable": s_c_il[0].account)}]); where s_c_il[0].account holds the account name, but with no success.
Tried following this guid as well: http://digitalinsightsworld.com/tag-manager/dtm/optimizely-implementation-check-list-adobe-sitecatalyst/
Does anyone have an idea of what is wrong? Or how to go forward?
Br,
Johan
I had the same problem... We're using AngularJS 1.4.x. The default value for sVariable is 's'. Generally stated, Optimizely expects window.s to be the omniture object. Angular abstracts this object to its own injectable item, and is therefore not a standard DOM/element off window. My quick hack was to set window.s = s from within the Omniture directive. I'm still working out the best location to do this assignment, but I can verify that I now see the custom eVar for Optimizely outgoing in our Omniture call (using Omnibug). Hope this helps!

What is BasicHttpBinding or WsHttpBinding in relation to a SOAP client used for?

I am trying to communicatie with a webapplication through its SOAP service. Now in the C# code I can create a client and login, get a session id. All is well. Upon constructing this client I could have provided a binding. I am trying to read on MSDN what the binding is good for, and I feel like I am getting flooded with all technical terms that are new for me. Is it binding like data binding to a view , to automate updating things when the datasource changes? Does the binding allow the server to call the client as well? And if the binding is specified, what are its benefits and how do I use it? Can someone give a real world example of what is possible with a binding and not possible without a binding?

Node.js NTLM HTTP Authentication, how to handle the 3 types

I'm trying to get NTLM Authentication working w/ Node.js. I've been reading this ( http://davenport.sourceforge.net/ntlm.html#theNtlmMessageHeaderLayout ). I send the header and get a Base64 authentication header.
I tried converting it from Base64 to UTF8 by making a new Buffer with base64 encoding and then calling toString('utf8') which returns a string something like
NTLMSSP\u0000\u0001\u0000\u0000\u0000\u0007�\b�\u0000
This is where I need help. I understand the NTLMSSP\u0000 is the null terminated signature, but and what the rest is supposed to indicate, but to me it's just garbage. It's unicode characters, but how am I supposed to get actual data out of that? I may be converting it incorrectly, which may be adding to my troubles, but I'm hoping someone can help.
Have a look at http://www.innovation.ch/personal/ronald/ntlm.html
What you receive is a Type-2 Message. The pages explains it in a very practical way. You have to extract the server challenge (nonce) and the server flags.
I just implemented a module for node.js to do just that: https://github.com/SamDecrock/node-http-ntlm
Have you looked at NTLMAPS?
You may be able to solve your problem by using it as a proxy server, but if you really want to implement NTLM auth in Javascript, then NTLMAPS provides lots of working code to study.
Sam posted the best resource I've seen for understanding what's going on.
jclulow on GitHub seems to have implemented it in a Samba library he built.
Take a look here:
https://github.com/jclulow/node-smbhash
under lib\ntlm.js you can see how he's handled the responses.
I've built client a couple of months ago using javascript, ntlm.js. Maybe that can help you get along. It was based on the documentation # innovation.ch and Microsofts own official documentation (see the references on the github page).

Resources