aws-samples / aws-secrets-manager-rotation-lambdas

Contains Lambda functions to be used for automatic rotation of secrets stored in AWS Secrets Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ORACLE MultiUser doesn't support if the password originally contains @ symbol

WilliamWeiWei opened this issue · comments

As we have:
conn = cx_Oracle.connect(secret_dict['username'] + '/' + secret_dict['password'] + '@' + secret_dict['host'] + ':' + port + '/' + `secret_dict['dbname'])

The connection string would be like username/password@host:port/SID

If at the beginning the original password contains @ symbol (say if it's pwd@123), it will never connect to database. Because the connection string becomes: username/pwd@123@host:port/SID, and the host is recognized as 123@host instead of host.

A simple change could avoid this behavior, to use below code:
conn = cx_Oracle.connect(secret_dict['username'], secret_dict['password'], secret_dict['host'] + ':' + port + '/' + secret_dict['dbname'])

Reference:
https://cx-oracle.readthedocs.io/en/latest/api_manual/module.html#
https://cx-oracle.readthedocs.io/en/latest/user_guide/connection_handling.html#connstr

commented

Thank you for opening this issue - we are looking into it.

PR #59 includes this change, resolving.