node-red - Node Credentials - credentials

Within a node-red flow I have a CassandraDatabase node with a user and pass. When I export the flow these credentials are not contained in the json, instead a flows_cred.json file appears with an encrypted string:
{"$": "df28.......
... however if I copy this file out and try to bring up my node-red instance elsewhere I get the following at startup:
[warn] Error loading credentials: SyntaxError: Unexpected token � in JSON at position 0
... followed by a repeating "AuthenticationError: Authentication provider not set", message. Indeed the credentials have not been picked up by the node-red flow and so I must input manually again.
Anyone know the trick to allowing me to export the credentials successfully?

The credentials file (flows_cred.json) is encrypted by default to ensure its contents cannot be easily read.
Node-RED generates a random key for the encryption if you do not provide one in your settings file. If the second instance of Node-RED doesn't have the same encryption key, it won't be able to decrypt the file.
Here are the steps you need to resolve this.
edit your settings.js file and add a credentialSecret property with a whatever string value you want. If you want to disable encryption, set its value to false.
credentialSecret: "my-random-string"
Restart Node-RED and deploy a change - this will trigger Node-RED to re-encrypt your credentials with your chosen key (or disabling encryption if set to false).
You can then copy your flow/credential file to a second instance, just make sure you give it the same credentialSecret value in its settings file.
Note that once you set credentialSecret you cannot change its value.

Related

is installing local node necessary to create wallet on test/main net?

i want to be able to create wallets on wave blockchain using their api
according to this
https://nodes-testnet.wavesnodes.com/api-docs/index.html#/addresses/createWalletAddress
i need to send API key in my request header .... i look into how can i obtain this api key and in the doc here are the steps
Set API Key
To set API key, you need to generate API key hash and then use it in
your node configuration.
Create unique string value that you will use as API key.
Go to Swagger web interface.
Open the /utils/hash/secure (opens new window)API method and input
your unique string in the message field.
Click Execute to get the hashed API key.
Use the hashed API key as the value of the api-key-hash parameter in
your node configuration file.
Restart your node.
it says
Use the hashed API key as the value of the api-key-hash parameter in
your node configuration file.
im very confused ... i thought using testnet means that i dont have to install a local node
maybe im wrong ?!
use this package
https://www.npmjs.com/package/#waves/waves-api
you need to creaate a seed pharase , and using the seed you can create address/public & private keys ... here is a shortcut to create all
const Waves = WavesAPI.create(WavesAPI.TESTNET_CONFIG);
const seed = Waves.Seed.create();
console.log(seed);

BIM360 Issues editor Forge Node JS App -trying to run on localhost 3000

I am trying to work with the BIM 360 Issue Editor created by Petr and available on github https://github.com/petrbroz/bim360-issue-editor/tree/develop
I have added all the dependencies,etc. but seem to be stuck with the configuration.
I am testing on local host and I am getting invalid URI error, what would be the correct configuration variables for launch.json file for
"HOST_URL": "http://localhost:3000","SERVER_SESSION_SECRET","CLI_CONFIG_PASSWORD"
Also there is SENDGRID_API_KEY required, which throws an error on the console, I add the key from SendGrid in config.js, and the error goes away. Is it correct?
Please suggest. Thanks
Here's more details about the env. variables:
HOST_URL is just the host/port the app is listening on (for example, http://localhost:3000)
This value is used to built the callback URL for the 3-legged OAuth workflow; for example, if the host URL is http://localhost:3000, the callback URL will be http://localhost:3000/auth/callback
Note that the same callback URL must be configured for your Forge app on https://forge.autodesk.com/myapps
SERVER_SESSION_SECRET is an arbitrary string that will be used to encrypt/decrypt browser cookies
CLI_CONFIG_PASSWORD is only needed when you want to use the command-line utility that's part of the sample code; in that case the configuration for the CLI utility will be zipped in a password-protected *.zip file using this env. variable as the password
SENDGRID_API_KEY is also optional and only needed if you want the app to send email notifications to users who triggered the Excel export

How to fix 'SDK client path is invalid' error in Thycotic Secret Server's API

I use Thycotic's Secret Server and am utilizing their API to query the password field of a secret. While using the API, I am receiving a SDK client path is invalid error.
Once I configured the connection (you only need to do it once according to the API documentation located at https://github.com/thycotic/secret-server-python), I then execute the query using:
from secret_server.sdk_client import SDK_Client
client = SDK_Client()
akey = client.commands.get_secret(1234, field='password').strip()
skey = client.commands.get_secret(4321, field='password').strip()
I expected to simply get my secrets when I print my akey and skey variables, but instead I get the error:
raise ValueError('SDK client path is invalid')
ValueError: SDK client path is invalid
What's interesting is that I have to run the configure command again to get it to work. I figure that's because when you actually go to configure the connection you specify the full path to your SDK client and you don't have to after you've already done it once.
Regardless, when I do, I get a machine is already initialized (as expected) response, and it then works. But you shouldn't have to do that. Plus, that would be an issue because the onboarding key will be stored in the code, and we can't have that.
Any suggestions?
I had a similar error; except I never got past the invalid SDK path.
I solved it by doing this:
Script A) init as outlined in the sdk documentation (only run once)
Script B)
client = SDK_Client()
client.config.SDK_CONFIG["path"] = path_to_my_sdk
key = client.commands.get_secret(1234, field = 'password')
Adding that middle line is what resolved the problem. I'll log this as an issue in the github that the init process apparently is not saving the path.

Access secret environment properties in IBM cloud deploy - NodeJS

I'm having some problem with accessing my secret environments properties I've set in my build stage. In the build environment properties I got two secret fields called "w_username" and "w_password", however, I can not access these properties inside of my NodeJS runtime. I've tried with process.env['w_username'] but it seems like it can't find it. How is it possible to access them?
Using NodeJS 6.x, npm 6.x with SDK for NodeJS on IBM cloud.
You can directly access the build environment properties in the next stage in the toolchain with their names like w_username and w_password.
You can examine the environment properties for a pipeline job by
running the env command in the job's script.
You can also define your own environment properties. For example, you might define an API_KEY property that passes an API key that is used to access IBM Cloud resources by all scripts in the pipeline.
You can add the following types of properties:
Text: A property key with a single-line value.
Text Area: A property key with a multi-line value.
Secure: A property key with a single-line value that is secured with AES-128 encryption. The value is displayed as asterisks.
Properties: A file in the project's
repository. This file can contain multiple properties. Each property
must be on its own line. To separate key-value pairs, use the equals
sign (=). Enclose all string values in quotation marks. For example,
MY_STRING="SOME STRING VALUE".
For more information, refer here
Hope this helps

How can I access the parameters of a service on a Carbon server in plain txt

What I've done is broken the default 'Version' service on my WSO2 DSS, I tried to set the Scopes variable for WS-Discovery and didn't put a closing tag/element when creating the parameter.
Now when I try to access the parameters screen I get an xml Parse error
TID: [0] [WSO2 Data Services Server] [2012-08-22 12:38:04,404] ERROR {org.wso2.carbon.service.mgt.ServiceAdmin} - Error occured while getting parameters of service : Version
{org.wso2.carbon.service.mgt.ServiceAdmin}org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '<' (code 60) in end tag Expected '>'. at [row,col {unknown-source}]: [2,58] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296) at
I'm assuming this is stored in the H2 database, I've tried looking for the parameter in the .db file using notepad but I can't find it.
Is there another way to connect/browse the H2 db?
I've scanned through the repository, database and conf directories for clues without success.
UPDATE:
Yes you can connect to the H2 db using the included database Explorer under the Tools menu.
Use the connection details found in the repository/conf/registry.xml file
Then you can do SQL queries on it - (I haven't found the answer yet though)
UPDATE 2:
I don't think the parameters are held in the H2 db, but I managed to fix my problem by:
downloading the Version.aar file using the link on the list services page
deleting the Version service
Copying the Version.aar file into the repository/deployment/server/axis2services dir
I guess deleting the service removed any records/references to my broken parameter
I believe you've tried setting service parameters via the UI? Usually the service parameters you specify via the UI do not get saved in the services.xml of the original axis2 service archive. Instead, they get saved in the registry that is shipped with DSS and get applied to the service at runtime. But if you specify a malformed parameter then wouldn't be saved in the registry instead, throwing an exception while trying to engage that parameter. So there'll be no record saved corresponding to that kind of malformed parameters.
Hope this helps!
Cheers,
Prabath

Resources