Commit graph

349 commits

Author SHA1 Message Date
b40b4b7e63
Add expanded fuzz testing to algo_test.go
This commit introduces several new fuzz tests to the algo_test.go file. These tests specifically target the IntToAlgo functionality to ensure proper handling of negative, out-of-range, and very large input values. By covering these edge-cases, we enhance the reliability of the algorithm conversion process.
2024-03-17 22:05:35 +01:00
f5f6a12e83
Merge pull request #68 from wneessen/security-md
Create SECURITY.md
2024-03-17 21:33:25 +01:00
f65feff1f9
Create SECURITY.md 2024-03-17 21:32:57 +01:00
7f8fbb05bc
Merge pull request #67 from wneessen/token-permissions
Add read permissions to GitHub workflows
2024-03-17 20:23:45 +01:00
b289d440da
Update Go build command in GitHub workflow
The GitHub workflow script has been updated to use a different command for building the Go application. This will ensure that the application is built with necessary parameters for correct operation and proper linking of static libraries.
2024-03-17 20:23:29 +01:00
ef8e334df0
Add read permissions to GitHub workflows
The reuse and docker-publish workflow scripts in GitHub Actions have been updated. Now these scripts have permission to read contents. This will ensure secure access and controlled operations on repositories.
2024-03-17 20:16:27 +01:00
ba891efd37
Merge pull request #64 from wneessen/codeql
Create codeql.yml
2024-03-17 20:02:09 +01:00
bfc12841ce
Update Go version and build command in codeql workflow
The codeql workflow script has been updated. Specifically, the Go version in the build command has been changed from 1.22.0 to 1.22.1+auto, to ensure alignment with the Go version specified elsewhere in the project. Additionally, the build command itself has been simplified, utilizing '/usr/bin/env' to consolidate dependencies.
2024-03-17 19:59:29 +01:00
4ea41be22f
Update Go version and simplify build script
The Go version in go.mod has been updated from 1.22 to 1.22.0 to avoid potential compatibility issues. Additionally, the build process in codeql.yml has been simplified by consolidating multiple 'go mod' commands into a single 'go build' command.
2024-03-17 19:51:46 +01:00
2691b04e38
Upgrade Go version in go.mod
The Go version specified in the go.mod file has been upgraded from 1.22 to 1.22.0. This may be necessary to avoid compatibility issues with updated systems and dependencies.
2024-03-17 19:49:43 +01:00
decf5526d1
Downgrade Go version in go.mod
The Go version specified in the go.mod file has been downgraded from 1.22.1 to 1.22. This change is necessary to maintain compatibility with systems and dependencies that may not yet support the latest version of Go.
2024-03-17 19:38:12 +01:00
061b9f4f7f
Upgrade Go version in go.mod
The Go version specified in the go.mod file has been upgraded from 1.21 to 1.22.1. This change ensures the use of the latest Go features and improvements, enhancing the overall project performance.
2024-03-17 19:36:40 +01:00
bffc8ac65e
Update Go version in go.mod
The Go version specified in the go.mod file has been downgraded from 1.22 to 1.21. This is to ensure compatibility with the project's specified dependencies.
2024-03-17 19:33:18 +01:00
6f25663957
Update Go build steps in GitHub workflow
The build steps in the CodeQL action of the GitHub workflow have been updated. Instead of using the 'apt-get' command, the 'go mod tidy', 'go mod download', and 'go mod verify' are now used. This improves the building process by organizing and verifying the dependencies.
2024-03-17 19:31:10 +01:00
31cf70c678
Update golangci-lint workflow permissions
The "read-all" permission has been eliminated from the .github/workflows/golangci-lint.yml file. In its place, more specific read permissions have been implemented to enhance security measures and establish accurate access levels.
2024-03-17 19:28:59 +01:00
4bc210f1ab
Refine permissions in CodeQL workflow
The "read-all" permission has been removed from the CodeQL workflow. Instead, the workflow now includes a specific read permission for contents, ensuring a more precise and secure access level.
2024-03-17 19:28:06 +01:00
b36aeeeab6
Update CodeQL workflow to include Go installation and building
The previous autobuild process has been disabled in the Github actions workflow. A new step for Go installation and manual building of the application using Go has been implemented, providing enhanced control and flexibility over the project's build process.
2024-03-17 19:24:19 +01:00
043008a97d
Update CodeQL workflow to include Go installation and building
The previous autobuild process has been disabled in the Github actions workflow. A new step for Go installation and manual building of the application using Go has been implemented, providing enhanced control and flexibility over the project's build process.
2024-03-17 19:22:18 +01:00
2af31dcb48
Disable Autobuild and setup manual Go build in CodeQL workflow
The Github actions autobuild functionality has been commented out and replaced with manual building using Go. This customized build command ensures better flexibility and control over the build process.
2024-03-17 19:19:38 +01:00
7ebaf2d2b7
Add read-all permissions to workflow files
This commit adds "read-all" permissions to golangci-lint, codecov, and sonarqube workflow files. This change ensures that all necessary activities are allowed during the workflow processes.
2024-03-17 19:15:34 +01:00
eec1b36edc
Add read-all permissions and SPDX license headers in codeql.yml
The commit adds SPDX-FileCopyrightText and SPDX-License-Identifier headers at the top of codeql.yml, specifying a CC0-1.0 license for Winni Neessen's 2022 copyright. It also grants read-all permissions, ensuring all needed activities are allowed in the file's workflow.
2024-03-17 19:14:42 +01:00
2d674214a7
Create codeql.yml 2024-03-17 19:12:21 +01:00
a61ac9b877
Merge pull request #61 from wneessen/fix_reuse
Add SPDX license headers in scorecard.yml
2024-03-17 19:06:13 +01:00
6697ac53db
Add SPDX license headers in scorecard.yml
SPDX-FileCopyrightText and SPDX-License-Identifier license headers have been added to the top of the scorecard.yml file. The headers pertain to the 2022 copyright of Winni Neessen and define the license to be CC0-1.0.
2024-03-17 19:05:33 +01:00
64f7eed954
Create scorecard.yml 2024-03-17 19:01:57 +01:00
4a6b9b325f
Update version number in README and apg.go for proper semver ruling
The version number has been corrected to 1.1.0 from 1.0.1. This change was made in both the README.md file and the apg.go file. This update reflects the new algorithm for binary secrets introduction in version 1.1.0 instead of version 1.0.1.
2024-03-17 18:31:58 +01:00
9f035c5834
Merge pull request #60 from wneessen/binary_random
Add binary mode for secret generation
2024-03-17 18:26:03 +01:00
183754e869
Add new test case to spelling_test.go
A new test case named "Pronounce_Mixed" has been added to the file spelling_test.go. This new case helps validate the behavior of the function when dealing with mixed syllables. More specifically, it deals with a situation where a number and a pronounceable syllable are combined, enhancing the overall robustness of the spelling tests.
2024-03-17 18:23:12 +01:00
c697a8ef8e
Update error handling in test for HasBeenPwned
The test for HasBeenPwned function in hibp_test.go has been updated to handle errors more effectively. Instead of failing the test directly upon encountering an error, it now logs the error and terminates the current subtest. This improves the test's resilience and makes debugging easier.
2024-03-17 18:23:04 +01:00
c8a4cf2837
Refactor variable initialization in generateBinary function
This commit refactors the way the 'length' variable is initialized in the generateBinary function of the Generator struct in random.go. Notably, it makes use of Go's type inference feature to eliminate the need to explicitly declare the variable type.
2024-03-17 18:12:17 +01:00
acadccc84a
Add binary mode for secret generation
This commit updates the password generator to now include a binary mode. This mode produces a 256 bits long fully binary secret which can be used for AES-256 encryption. New flags `-bh` (print hex representation) and `-bn` (new line after secret) have been added for this mode. The version has also been updated to 1.0.1 recognizing this new addition.
2024-03-17 18:09:27 +01:00
641af1f88c
Merge pull request #59 from wneessen/pin-gen
Add examples section to README.md and pin-generator example
2024-03-16 11:17:39 +01:00
2c7db946be
Add examples section to README.md and pin-generator example
This commit introduces a new "Examples" section in the README.md to illustrate usage, ranging from website login password, PIN generation, to phone verification. In addition, it includes a new file under the example-code directory for a PIN generator using apg-go.
2024-03-16 11:17:06 +01:00
3e819976f6
Merge pull request #58 from wneessen/fix_typos
Fix typos
2024-03-16 10:45:01 +01:00
bdf7fdf7e1
Fix typographic errors in README.md
This commit rectifies a couple of typographic errors in the README.md file. Notably, there was a typo 'abondoning' which has been corrected to 'abandoning' and, it tidies up punctuation within the sentences. The main focus was to ensure readability and clarity of the documentation.
2024-03-16 10:44:28 +01:00
b76e5ef57d
Fix typo errors and correct 'pronouncable' to 'pronounceable' in README
Corrected all the occurrences of the word 'pronouncable' to correct spelling 'pronounceable' across the README file. Also fixed a small typo 'apt-go', replaced it with the correct term 'apg-go'. The changes ensure correct spelling and consistent terminology in the README document.
2024-03-16 10:37:17 +01:00
4751de3389
Merge pull request #57 from wneessen/update_readme
Update README with detailed installation instructions
2024-03-16 10:28:32 +01:00
4ee866bd61
Update README with detailed installation instructions
The README file has been updated with thorough installation instructions. Changes range from introducing binary and package releases, including their verification using GPG signature, to refactoring the source code installation steps. Additionally, instructions for specific platforms like FreeBSD, Arch Linux, Debian/Redhat/Alpine, etc., have been improved for clarity.
2024-03-16 10:27:56 +01:00
3b1ce9009a
Merge pull request #56 from wneessen/goreport_cleanup
GoReportCard cleanup
2024-03-14 23:00:32 +01:00
89a2a349ef
Fixed missing gofumpt for apg.go 2024-03-14 22:57:07 +01:00
4ee6b6651b
Refactor character counting logic in password validation
The repetitive code used for password character counting in different scenarios has been consolidated into a single function, matchesMinimumAmount(). This extraction simplifies the main function and makes the code more maintainable, while maintaining the functionality of checking whether the password meets certain character count criteria.
2024-03-14 22:54:36 +01:00
cc45ec1119
Reduce complexity in main() function 2024-03-14 22:45:20 +01:00
f153754dc4
Correct typo in test error message
The error message within the test case had a typographical error. The word "length" was incorrectly spelled as "lenght". This has been fixed to enhance the readability of the code.
2024-03-14 22:28:35 +01:00
da910fde14
Merge pull request #55 from wneessen/more_testcoverage
Add test for excluded characters in config
2024-03-14 21:46:48 +01:00
9bb78748be
Add test for excluded characters in config
A new unit test has been added to verify GetCharRangeFromConfig() function. The test ensures that the function properly excludes configured characters from the generated range.
2024-03-14 21:39:48 +01:00
ddae28d1a9
Correct version references in README and apg.go
The version number in several instances in the README file and apg.go has been modified from v2.0.0 to v1.0.0. This more accurately reflects the version where the changes were implemented and ensures consistency across all documentation.
2024-03-14 11:26:32 +01:00
3847ab0735
Update GPG key contact info in README.md
Updated the "Winni Neessen" Software signing key contact details in the README file for better readability and neatness. This conveys the same information but in a more compressed, comprehensible manner.
2024-03-14 11:08:48 +01:00
6b08e1077c
Update README with new features and clean-up goreleaser config
Updated the README file to document new features added in the codebase: codecov badge, pre-built package usage, fixed-length password flag usage, coinflip mode, and the minimum required characters. The goreleaser configuration (`.goreleaser.yaml`) was cleaned up, removing unnecessary sections for docker usage. This clarifies how to execute certain functionalities and makes the goreleaser configuration easier to read and maintain.
2024-03-14 11:07:56 +01:00
83c67b33be
Add codecov configuration file and simplify coverage profile generation
A codecov.yml configuration file has been added to specify the coverage target and other codecov settings. The CI pipeline has also been streamlined to directly generate the coverage profile without using grep for filtering ignored code paths. This makes it easier to understand and maintain the testing and coverage reporting process.
2024-03-14 10:35:43 +01:00
aae55baa1d
Refine coverage profile generation in CI pipeline
The codecov workflow in the CI pipeline has been adjusted to produce more accurate coverage profiles. Previously covered but now-ignored code has been removed from the coverage profile by filtering out desired patterns with 'grep'.
2024-03-14 10:28:40 +01:00