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

feat(security): new module #1151

Open
wants to merge 20 commits into
base: next
Choose a base branch
from

Conversation

thisislawatts
Copy link

@thisislawatts thisislawatts commented Jul 13, 2022

Introduces a security module which allows users to generate one of the following:

These are a few of the broadly supported standards which have seen adoption by the security community. Although there are a few emerging alternatives as well.

I do not believe that any localisation is needed for these but happy to do some further research but thought I'd share the work as it stands and see if it seemed interesting to anyone else.

@codecov
Copy link

codecov bot commented Jul 14, 2022

Codecov Report

Merging #1151 (a3945eb) into main (5bdba8b) will increase coverage by 0.00%.
The diff coverage is 97.67%.

❗ Current head a3945eb differs from pull request most recent head f4b2053. Consider uploading reports for the commit f4b2053 to get more accurate results

@@           Coverage Diff            @@
##             main    #1151    +/-   ##
========================================
  Coverage   99.62%   99.62%            
========================================
  Files        2163     2165     +2     
  Lines      241264   240858   -406     
  Branches     1013     1031    +18     
========================================
- Hits       240356   239954   -402     
+ Misses        887      883     -4     
  Partials       21       21            
Impacted Files Coverage Δ
src/modules/security/index.ts 97.41% <97.41%> (ø)
src/faker.ts 100.00% <100.00%> (ø)
src/internal/toDate.ts 100.00% <100.00%> (ø)
src/modules/date/index.ts 99.01% <100.00%> (-0.09%) ⬇️
src/modules/datatype/index.ts 96.03% <0.00%> (-0.22%) ⬇️
src/modules/helpers/index.ts 98.43% <0.00%> (-0.08%) ⬇️
src/modules/random/index.ts 97.63% <0.00%> (-0.06%) ⬇️
src/modules/color/index.ts 99.71% <0.00%> (-0.03%) ⬇️
src/modules/address/index.ts 99.81% <0.00%> (-0.02%) ⬇️
... and 22 more

@import-brain import-brain added the c: feature Request for new feature label Jul 14, 2022
@import-brain import-brain added this to the v7 - Current Major milestone Jul 14, 2022
@import-brain import-brain added the s: needs decision Needs team/maintainer decision label Jul 14, 2022
src/definitions/security.ts Outdated Show resolved Hide resolved
src/modules/security/index.ts Outdated Show resolved Hide resolved
src/modules/security/index.ts Outdated Show resolved Hide resolved
@thisislawatts
Copy link
Author

Thanks @ST-DDT and @Shinigami92 both for taking the time to review the work here so far. ✨

test/security.spec.ts Outdated Show resolved Hide resolved
src/modules/security/index.ts Outdated Show resolved Hide resolved
src/modules/security/index.ts Outdated Show resolved Hide resolved
src/modules/security/index.ts Outdated Show resolved Hide resolved
scripts/generateLocales.ts Outdated Show resolved Hide resolved
src/internal/toDate.ts Outdated Show resolved Hide resolved
src/modules/security/index.ts Outdated Show resolved Hide resolved
src/modules/security/index.ts Outdated Show resolved Hide resolved
@Shinigami92 Shinigami92 changed the title feat: introduces security module feat(security): new module Aug 12, 2022
@thisislawatts thisislawatts marked this pull request as ready for review August 17, 2022 06:01
@thisislawatts thisislawatts requested a review from a team as a code owner August 17, 2022 06:01
src/modules/security/index.ts Outdated Show resolved Hide resolved
test/security.spec.ts Outdated Show resolved Hide resolved
@thisislawatts
Copy link
Author

@ST-DDT Can I get approval for these workflows to run and see how it fairs?

@thisislawatts
Copy link
Author

Investigating:

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  test/scripts/apidoc/examplesAndDeprecations.spec.ts > examples and deprecations > Security > cve
Error: Transform failed with 1 error:
 ❯ failureErrorWithLog node_modules/.pnpm/esbuild@0.14.54/node_modules/esbuild/lib/main.js:1624:15
/home/runner/work/faker/faker/test/scripts/apidoc/temp/Security/cve.ts:3:83: ERROR: Expected "}" but found ")"
 ❯ node_modules/.pnpm/esbuild@0.14.54/node_modules/esbuild/lib/main.js:1413:29
 ❯ node_modules/.pnpm/esbuild@0.14.54/node_modules/esbuild/lib/main.js:678:9
 ❯ handleIncomingPacket node_modules/.pnpm/esbuild@0.14.54/node_modules/esbuild/lib/main.js:775:9
 ❯ Socket.readFromStdout node_modules/.pnpm/esbuild@0.14.54/node_modules/esbuild/lib/main.js:644:7
 ❯ Socket.emit node:events:513:28

src/modules/security/index.ts Outdated Show resolved Hide resolved
src/modules/security/index.ts Outdated Show resolved Hide resolved
src/modules/security/index.ts Outdated Show resolved Hide resolved
src/modules/security/index.ts Show resolved Hide resolved
Copy link
Member

@import-brain import-brain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this module to the readme.

@thisislawatts thisislawatts requested a review from a team September 1, 2022 06:03
src/modules/security/index.ts Outdated Show resolved Hide resolved
@ST-DDT
Copy link
Member

ST-DDT commented Sep 2, 2022

Docs Preview

Click to expand

grafik

@ST-DDT ST-DDT removed the s: needs decision Needs team/maintainer decision label Sep 2, 2022
@import-brain import-brain removed the needs rebase There is a merge conflict label Sep 9, 2022
src/modules/security/index.ts Outdated Show resolved Hide resolved
src/faker.ts Outdated Show resolved Hide resolved
@ST-DDT
Copy link
Member

ST-DDT commented Sep 9, 2022

All methods now need a @since 8.0.0

@thisislawatts
Copy link
Author

thisislawatts commented Sep 10, 2022

All methods now need a @since 8.0.0

@ST-DDT Doesn't this kind of depend on the module getting user interest? I can see that introducing a @since property to each doc block is, an outstanding task before the work is mergeable but seems impossible to know exactly what release version this would land in.

@ST-DDT
Copy link
Member

ST-DDT commented Sep 10, 2022

The @since is needed to pass the tests.
Sure the version might needs to be changed later/before merging, but at least it is visible.
If the test fail, the PR is less likely to be reviewed and reacted to.

@ST-DDT ST-DDT added the needs rebase There is a merge conflict label Nov 21, 2022
@matthewmayer matthewmayer linked an issue Apr 22, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature needs rebase There is a merge conflict s: waiting for user interest Waiting for more users interested in this feature
Projects
No open projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Security module for generating CWE, CVE and CVSS
4 participants