You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/05 12:36:15 UTC

[GitHub] [airflow] potiuk commented on pull request #15089: Added azure postgres connection url format

potiuk commented on pull request #15089:
URL: https://github.com/apache/airflow/pull/15089#issuecomment-813371373


   I looked at it again, and this PR proposal is actually wrong. The URI you are trying to use is wrong. 
   
   We actually even have a detailed description about this in http://airflow.apache.org/docs/apache-airflow/stable/howto/connection.html?highlight=uri#handling-of-special-characters-in-connection-params and we even described how to generate the connection URI properly: http://airflow.apache.org/docs/apache-airflow/stable/howto/connection.html?highlight=uri#generating-connection-uri
   
   You are not supposed to have `@` character in the user part of the URI. This is strictly forbidden in the https://tools.ietf.org/html/rfc3986 and if we allow that, it leads to a number of ambiguities. 
   
   We MUST strictly follow the specification rather than bypass it.
   
   Read the "Reserved Characters" part of the specification. Those are the `gen-delims` charatcters :
   ```
    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
    gen-delims  = ":" / "/" / "?" / "#" / "[" / "]" / "@"
    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
                    / "*" / "+" / "," / ";" / "="
   ```
   Follow it further and you will see that while the user information can contain sub-delims, it 
   MUST NOT contain gen-delims characters. If they are needed, they must be percent-encoded:
   
   ```
   userinfo    = *( unreserved / pct-encoded / sub-delims / ":" )
   ```
   This means that in your case, if you want to use user name containing the `@` character (which is part of `gen-delims`) you must percent-encode it. Your user-name should look like this:
   
   ```
   YourUserName%40YourDatabaseName:
   ```
   
   I am closing that one as invalid -  but it would be great @cccs-cat001 if you verify that the percent-encoding helps to address your problem. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org