-
Notifications
You must be signed in to change notification settings - Fork 631
[CO-388] Pull out cardano-x509-certificates internals as a library #3610
Conversation
This module was currently defined as a binary executable for cardano-sl-tools which makes it impossible to require it from any other library. Ideally, we would like to keep the executable as it is but have the library exposed somewhere else. That will come in handy for integration tests and also in the launcher code. Doing so, I've also removed the {#- RecordWildCards -#} extension and turned non specific imports to specific ones.
d5cc158
to
8f20d8e
Compare
@disassembler @cleverca22 |
(serverHost, serverPort) | ||
cert | ||
writeCredentials (certOutDir desc </> certFilename desc) (key, cert) | ||
writeCertificate (certOutDir desc </> caName) caCert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing {-# RecordWildCards #-}
extension and defining cmdParser
at a higher level for readability. All indentation has therefore shifted.
-- * Effectful Functions | ||
, ConfigurationKey(..) | ||
, decodeConfigFile | ||
, genCertificate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-organizing the exports to be clearer since this is now a library.
|
||
addMinutes :: Int -> DateTime -> DateTime | ||
addMinutes n time = | ||
timeAdd time (Minutes $ fromIntegral n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
genCertificate
used to be defined in gencerts/Main.hs
, I pulled it into the library since it's quite a re-usable piece.
One possible addition after this (or part of this) could be to have a simple tests, generating certificates and verifying that they're all valid. That could easily be done with a quickcheck properties generating random Basically, moving the following into a property-test: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a property test upcoming, so lets go with this.
Description
This module was currently defined as a binary executable for
cardano-sl-tools which makes it impossible to require it from any other
library. Ideally, we would like to keep the executable as it is but have
the library exposed somewhere else. That will come in handy for
integration tests and also in the launcher code.
Doing so, I've also removed the {#- RecordWildCards -#} extension
and turned non specific imports to specific ones. Apart from that, there's no
real logical change, just a bit of reshuffling.
Linked issue
[CO-387]
Type of change
Developer checklist
Testing checklist
[ ] I have added tests to cover my changes.QA Steps
Screenshots (if available)