Airflow Password Variable - variables

I have airflow variable named as mysql_password and set its value which is visible as **** after saving. When I try to access it using Variable.get, it still returns the **** value instead of the actual password. I read that if the variable name contains keyword 'password', it will be encrypted. But it does not seem to work this way. Any method of how to reading the value of this encrypted variable?

Related

ms sql connection string with semi colon in password failing to connect

Am working on anypoint studio 6.6.8 with runtime 3.9.4EE.
I have the following mssql generic database connection string.
jdbc:sqlserver://ABC.org:59000;databaseName=master;username=nrp;password=*37n%3b#wu;5r:;_1z~(f{1y{j
Test connection gives me the following error:
Test connection failed:
org.mule.module.db.internal.domain.connection.ConnectionCreationException: Cannot get connection for URL jdbc:sqlserver://ABC.org:59000;databaseName=master;username=nrp;password=<<credentials>>;5r:;_1z~(f{1y{j: The connection string contains a badly formed name or value
PS: I have 2 semi colons in password
I have seen similar question raised here earlier a few times, hence my question might look repetitive.
however I tried the following solutions given in the replies. none of them worked. Please let me know if you have any alternate solution.
Enclosing the password in single quotes.
adding \ in front of ;
Enclosing password within double quotes or {}
Am not the admin hence removing ; from password cannot be done.
The connection string is in a format known as JAVA JDBC URL. It is similar to a normal URL. Many characters are not allowed in URLs and have to be encoded with the URL encoding method. Try using URL encoding for the entire URL. You can do it with most languages or online pages, though you might want to avoid public pages for sensitive information like passwords.
Example in Groovy: https://stackoverflow.com/a/10187493/721855.
Example in Python: https://stackoverflow.com/a/5607708/721855.
Thank you #aled
So the {} did work. I was doing it the wrong way.
I was encrypting the password & later concatenating {} to the decrypted password right b4 passing the connection string.
What worked was that I enclosed the password in {} first & then encrypted it.

How to disable the property of password-generator in OpenDJ

By default, the value of password-generator in Default Password Policy is Random Password Generator, and then if I try to set a password for a user, I'll get an error shows I cannot provide a password.
But in my case, I want the user can set his/her initial password when the account is created. So, how can I disable the property and just let user set the password?
The password-generator is only used when trying to set or change a password with ldappasswordmodify and no new password is passed as parameter.
If you are getting an error when trying to set a password for a user, it is not due to the password-generator. It's something else, and the error message that you can find in the Access log should be pretty explicit.

Passing a token to a Keyword - Robot Framework

How do I pass a token to another Keyword?
I've created a session and get the token using the following:
${token} set variable ${response.json()["authenticationToken"]}
${head} create dictionary Authorization=Bearer ${token} Content-Type=application/json
In another Keyword I want to create a new session using the above ${head}.
How do I pass this correctly?
Create session list https://whatever.com/ verify=True headers={head}
Because head is a local variable the new session has no clue what this ${head} is in the above code.
You can have the keyword that gets the token and creates the ${head} dictionary return it; then you'll have the value in the calling test case / glue keyword, and pass it to the one that's creating the session.
Another possibility is for the keyword getting the token to set the scope of the ${head} variable to test (Set Test Variable) or suite (Set Suite Variable) level - thus it will be defined for all keywords called after that scope setting.

Passing multiple values between ThreadGroups - Jmeter

I have ThreadGroup1 which performs login operation where it is getting Credentials from CSV file using CSV Dataset Config and saves username and password in two different variables like:
${__setProperty(USERNAMEGlobal, ${USERNAME})}
${__setProperty(PASSWORDGlobal, ${PASSWORD})}
Now in ThreadGroup2 I use these credentials using:
${__property()}
it works fine for a single user, but if I try multiple users (requests) last value overrides the previous all values and ThreadGroup2 receives only the last credentials defined.
I want all the credentials to be passed one by one to ThreadGroup2 and then the requests present in ThreadGroup2 should work according to all those credentials respectively.
How this can be done?
PS: I defined ramp-up period=1, Number of Users=3, loop=1.
There are some options:
Inter-Thread Communication.
Put them to different properties:
${__setProperty(USERNAMEGlobal1, ${USERNAME1})}
${__setProperty(USERNAMEGlobal2, ${USERNAME2})}
etc.
Initialize array with all usernames, stringify it and then put to property. However, it looks like a hack that will slow your plan.
Looks like you can save all the username-password pairs into file csv-file in ThreadGroup1 and then re-use they in ThreadGroup2 via e.g. reading with CSV Data Set Config.
I'm wondering if you really need two separate ThreadGroups?
It seems like you need only one ThreadGroup inside which you should perform your login actions and then save user/pass parameters in vars, not in props. Vars are thread local, so values of one thread won't override values of another.
You can set variable within the script: vars.put("var_name", "var_value"), and then use it like ${var_name}. Another option to set variable.

HSQLDB - invalid authorization specification

I need help with an issue during the database connection via JPA/Hibernate on hsqldb-2.2.8:
[AWT-EventQueue-0] ERROR org.hibernate.util.JDBCExceptionReporter - invalid authorization specification - not found: manasouza
I created some user (manasouza) with some password as:
CREATE USER manasouza PASSWORD 123 ADMIN
I'm using SQLWorkbench as my database visualizer, and with it I can log on normally.
Using JPA/Hibernate I already tried the username on uppercase and the password as '123' or as the value cryptographed showed on the PASSWORD_DIGEST column at SYSTEM_USERS database table, but had no success at all.
When you use CREATE USER manasouza PASSWORD 123 ADMIN, HSQLDB 2.2.8 throws an exception. Therefore you must have used a different password.
The user name is converted to all uppercase because it is not double quoted. For the password, you should use single quotes around the string. If you define the password without the single quotes, it must start with a letter and is converted to all uppercase. Therefore if you want the exact case, use CREATE USER "manasouza" PASSWORD '123' ADMIN