
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
A library to parse credential-in-url and convert them to database connection urls
This package replaces both PostgresConnString.NET and mongo-url-parser as they are very basic packages.
It aims to grant general .NET support for parsing and converting urls in the form "scheme://user:password@host:port/database?connectionparameters" also known as Credential-In-Url and converting it to formats easily used by the database service providers for .NET.
You can install the package from nuget
Install-Package ciu-parser
or
dotnet add package ciu-parser
or for paket
paket add ciu-parser
To parse a url
using CredentialsInUrlParser;
...
var details = CIU.Parse("postgres://someuser:somepassword@somehost:381/somedatabase");
The resulting details contains a subset of the following properties:
Scheme
- Database server schemeHostName
- Database server hostnamePort
- port on which to connectUserName
- User with which to authenticate to the serverPassword
- Corresponding passwordDatabasePath
- Database name within the serverAdditionalQueryParameters
- Additional database parameters provided as query optionsCurrently, this library allows for generating an Npgsql compatible connection strings. With the following parameters
pooling
: type: boolean, default: truetrustServerCertificate
: type: boolean, default: truesslMode
: type: enum, default: Preferusing CredentialsInUrlParser;
...
var details = CIU.Parse("postgres://someuser:somepassword@somehost:381/somedatabase");
var connString = details.ToNpgsqlSConnectionString(); //User ID=someuser;Password=somepassword;Server=somehost;Port=381;Database=somedatabase;Pooling=true;SSL Mode=Prefer;Trust Server Certificate=true
This library also allows for generating a MongoDB compatible connection string and database name.
using CredentialsInUrlParser;
...
var details = CIU.Parse("mongodb://user:password@host:port/database-name?otheroptions");
var (dbUrl, dbName) = details.ToMongoConnectionSplit();
// dbUrl: mongodb://user:password@host:port?otheroptions
// dbName: database-name
Feel free to make requests and to open P=pull requests with fixes and updates.
FAQs
A library to parse credential-in-url and convert them to database connection urls
We found that ciu-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.