Jaymon / dsnparse

Easily parse DSN urls (connection strings) in Python
MIT License
21 stars 8 forks source link

DSN variations #10

Open Jaymon opened 1 year ago

Jaymon commented 1 year ago

Morp requires the @ at the end of an SQS dsn:

sqs://${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}@

I'd love to see if there was a way to avoid having to add the @. So something like this would be valid:

sqs://${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}

I know why I never made something like this work, because username:password looks a lot like host:port when parsing. But I'm wondering if I could enable something like this.

Likewise, I wanted to do something like this:

sqs://${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}@${AWS_ROLE_ARN}

But the arn has a format like:

arn:aws:iam::<USER-ID>:role/<ROLENAME>

And that has similar characteristics to host:port also.

I was thinking this could be enabled by expectation flags, so you could do something like:

expect_user=False, expect_host=False

That can tell the parser what to expect.

Likewise, it would be nice to make it easier to customize the parsing.