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

New record type: OPENPGPKEY #2370

Closed
systemcrash opened this issue May 17, 2023 · 7 comments
Closed

New record type: OPENPGPKEY #2370

systemcrash opened this issue May 17, 2023 · 7 comments

Comments

@systemcrash
Copy link
Contributor

Would this be interesting?

Some providers support this record type. I mainly did this as code-golf, for fun.

It is PR ready, just needs a re-base.

It required a PR for the miekg lib to fix a buffer issue, which is now merged.

It requires at least miekg/dns@730c265 or 1.1.54

I know many orgs use (ECC) PGP Keys for security disclosures, and some (wish to) post those via DNS.

@tlimoncelli
Copy link
Contributor

Hi Paul!

In general I'm weary of adding DNS types that aren't commonly used. Can I see the PR?

Tom

@systemcrash
Copy link
Contributor Author

You can preview one here.

@tlimoncelli
Copy link
Contributor

Well, that's quite an impressive bit of coding you've done there. You've even implemented the integration tests.

I'd be glad to include this in the project, but you'll be on the hook for maintaining it since it isn't something I have a lot of expertise in. Ok?

One code change I'd like to suggest: Shift the logic out of helpers.js into the Go code.

A lot of the processing is done in Javascript in helpers.js. That makes it difficult to test and debug. (Not that there aren't testing frameworks for Javascript, but we can't use them because of otto, etc.) In general the functions in helpers.js (like A, CNAME, etc.) just pass along the human input and do the "heavy lifting" in Go. Go has the advantage of the libraries and testing frameworks that we know well. I would suggest putting that code in its own module (for example dnscontrol/pkg/openpgpkey)

Tom

@systemcrash
Copy link
Contributor Author

I looked around for places to put the heavy lifting in go because it seems like better APIs are available especially for the UTF8 normalization parts, but there does not seem to be an appropriate place to do so. The multiple pathways seem to be set up to take data immediately from js files and into use in records. Do I just need to be creative or is there a recommended point to start massaging the data so it's ready for use everywhere, irrespective of the ingress route?

@tlimoncelli
Copy link
Contributor

Good question!

The Javascript exports the result as JSON. The fields are the names of the object keys. The import is done by the UnmarshlJSON functions in models/record.go:

func (rc *RecordConfig) UnmarshalJSON(b []byte) error

A good example is the "target" field. It isn't exported. So, the javascript exports it with a field called .Target (creative name, eh?) and the imported specially to the .target field.

Your code would do something similar but would do transformations on the data first.

@tlimoncelli
Copy link
Contributor

Any interest in submitting that as a PR?

@systemcrash
Copy link
Contributor Author

systemcrash commented Dec 14, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants