Skip to content

Commit

Permalink
ci: ensure all certificates are valid and parsable (#6)
Browse files Browse the repository at this point in the history
* ci: ensure certificates are from Amazon RDS

* ci: improve messages
  • Loading branch information
wellwelwel committed Apr 13, 2024
1 parent 2a98699 commit 329f96e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
16 changes: 15 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"devDependencies": {
"@types/node": "^20.12.7",
"@types/x509.js": "^1.0.3",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"eslint": "^8.57.0",
Expand All @@ -20,7 +21,8 @@
"poku": "^1.9.3",
"prettier": "^3.2.5",
"tsx": "^4.7.2",
"typescript": "^5.4.4"
"typescript": "^5.4.4",
"x509.js": "^1.0.0"
},
"files": [
"lib"
Expand Down
19 changes: 19 additions & 0 deletions test/unit/verify-certs.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import x509 from 'x509.js';
import { describe, assert } from 'poku';
import { defaults } from '../../src/profiles/ca/defaults.js';

describe('Ensuring all certificates are valid and parsable', {
pad: true,
background: false,
});

defaults.forEach((cert, index) => {
const parsedCert = x509.parseCert(cert);
const expected = 'Amazon RDS';

assert.strictEqual(
parsedCert.issuer.organizationalUnitName,
expected,
`Certificate at index ${index} from defaults`
);
});

0 comments on commit 329f96e

Please sign in to comment.