Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming and Usage #5

Closed
wellwelwel opened this issue Apr 10, 2024 · 3 comments · Fixed by #7
Closed

Naming and Usage #5

wellwelwel opened this issue Apr 10, 2024 · 3 comments · Fixed by #7
Milestone

Comments

@wellwelwel
Copy link
Collaborator

wellwelwel commented Apr 10, 2024

Naming

In sidorares/node-mysql2#2581 (comment), the suggested name was awsCaBundle.

We should use this?

Currently, the temporary name is just profiles.


Usage

Based in the current temporary name and prioritizing not breaking changes.

mysqljs/mysql and node-mysql2

const profiles = require('aws-ssl-profiles').profiles;

exports['Amazon RDS'] = profiles;
  • Screenshot 2024-04-10 at 08 10 12

CJS (directly)

const { profiles } = require('aws-ssl-profiles');
// ...

const conn = mysql.createConnection({
  ssl: profiles,
);

ESM (directly)

import { profiles } from 'aws-ssl-profiles';
// ...

const conn = mysql.createConnection({
  ssl: profiles,
);

ℹ️ Notes

  • The current profiles match the exact profiles from MySQL2 3.9.4.
  • I opted to use named exports instead of default exports to simplify use (and development) for both CJS and ESM. Please let me know if it's a problem.
@wellwelwel wellwelwel added this to the v0.1.0 milestone Apr 10, 2024
@wellwelwel wellwelwel mentioned this issue Apr 10, 2024
5 tasks
@sidorares
Copy link
Member

can we just have it as a default export, so we don't need to think about name?

import profiles from 'aws-ssl-profiles';

also in mysql2 lib/constants/ssl_profiles.js we export an object with profiles where only key currently is 'Amazon RDS'. I think the intention was to add later more profiles from other known services. Given that we haven't added any other, and repo name suggests it's aws focused, maybe we can just export here the content of reauire('lib/constants/ssl_profiles.js')['Amazon RDS']

Happy to discuss the scope here, and we at the stage when we can rename things easily:

  • Are the any other AWS services that have different cert bundle?
  • Are there any other popular services that might benefit from a npm packaged cert distribution?

@wellwelwel
Copy link
Collaborator Author

wellwelwel commented Apr 10, 2024

can we just have it as a default export, so we don't need to think about name?

Of couse 🙋🏻‍♂️

@wellwelwel
Copy link
Collaborator Author

wellwelwel commented Apr 10, 2024

maybe we can just export here the content of reauire('lib/constants/ssl_profiles.js')['Amazon RDS']

So, that's the current situation, but I just did a copy/paste, except for the TypeScript adaptation 🙋🏻‍♂️

https://github.com/mysqljs/aws-ssl-profiles/blob/2a986994cd4066ce083f6d41d21b48b22d10477a/src/profiles/ca/defaults.ts


Lastly, I created it in a way that we can add more certificates dinamically.

For example, the default option would be to bring in all the certificates, but we can also use an export for each certificate category individually.

@wellwelwel wellwelwel linked a pull request Apr 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants