Commit graph

573 commits

Author SHA1 Message Date
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
349ccfe219
Merge pull request #54 from wneessen/wneessen-patch-1
Create codeql.yml
2024-03-14 10:18:55 +01:00
451a70f2b9
Create codeql.yml 2024-03-14 10:18:34 +01:00
b8b33e86af
Remove deprecated codeQL workflow 2024-03-14 10:09:31 +01:00
8b1b1aedcd
The provided commit message does not correspond to the described code diff. Based on the given diff, here's an appropriate commit message:
Set file permission during Docker copy action

The Dockerfile has been updated to set the file permission to 555 during the copy action for '/builddir/apg-go'. This change ensures that the appropriate user permissions are set right from when the image is built.
2024-03-14 10:07:44 +01:00
c0588f952a
Add SPDX license identifiers to main.go
The identifiers include the FileCopyrightText for the years 2021-2024 attributed to Winni Neessen, and the License to be under MIT. This addition brings the file into compliance with licensing standards.
2024-03-14 09:56:38 +01:00
c866d0775f
Create Codecov workflow for Go project
Added a new workflow in '.github/workflows/codecov.yml' that runs on all three OS: Ubuntu, MacOS, and Windows with '1.22' version of Go. This workflow performs a test coverage check and then uploads the coverage data to Codecov. The workflow is activated on every 'push' or 'pull request' to the 'main' branch.
2024-03-14 09:47:13 +01:00
82b015d819
Add simple password generator code
Created a new file "main.go" to add a simple password generator script using the apg library. This piece of code generates a random password with a fixed length of 15 characters including special characters, numeric, lower and uppercase letters.
2024-03-14 09:43:21 +01:00
cf47feecbb
Update project URLs and refactor Dockerfile
Project URLs have been changed in several files from "src.neessen.cloud/wneessen/apg-go" to "github.com/wneessen/apg-go". In addition, Dockerfile has been significantly refactored. It now includes steps for tidy and verify of Go modules and builds a statically linked binary. Several metadata files have been added with copyright information.
2024-03-14 09:37:52 +01:00
ff40c5d9f8 Updated .goreleaser 2024-03-14 00:44:13 +01:00
5e79643ffe Updated .goreleaser 2024-03-14 00:36:33 +01:00
1867c2ad44 Merge branch 'main' of ssh://src.neessen.cloud:222/wneessen/apg-go 2024-03-14 00:32:07 +01:00
dbc247a859 Updated .goreleaser 2024-03-14 00:29:42 +01:00
2bfd52313d
Remove redundant output line from .goreleaser.yaml
The .goreleaser.yaml configuration been updated to remove the redundant output line under docker_signs. This change simplifies the configuration without changing the functionality of Docker image signing. The password for the Docker registry is still sourced from the 'COSIGN_PWD' environment variable.
2024-03-14 00:13:08 +01:00
ac53637f86
Add Docker signing in .goreleaser.yaml
The .goreleaser.yaml configuration has been updated to include Docker image signing. This is accomplished by utilizing 'docker_signs' and specifying 'artifacts: all', allowing to process and authenticate all output Docker images. The user's password for the Docker registry is taken from the environment variable 'COSIGN_PWD'.
2024-03-14 00:11:19 +01:00
0ec81e16cc
Simplify Dockerfile setup
The Dockerfile has been streamlined to remove unnecessary steps and over-complications. Previously the setup involved building in a separate stage and copying files over, which has now been simplified to just copying the necessary executable to the scratch container and specifying the entry point.
2024-03-14 00:03:04 +01:00
f871dfb82b
Add build_flag_templates to .goreleaser.yaml
Extended the .goreleaser.yaml configuration with build_flag_templates options for the Docker image. These new flags introduce image labels for open containers, which provides more detailed image information including the creation date, project name, revision, and version.
2024-03-13 23:59:08 +01:00
48c352f998
Add image templates to .goreleaser.yaml
Added four Docker image templates in the .goreleaser.yaml file. The newly introduced templates specify the image tags based on the version, making it easier to handle different versions of the Docker image for the "apg-go" project.
2024-03-13 23:54:02 +01:00
48a0b6763b
Modify Docker build process and workflow
The Docker build command in the GitHub workflow file (docker.yml) now requires sudo privileges. Additionally, the Dockerfile has been expanded to not only tidy up and verify the Go modules project but also to alter the build path for the "apg-go" executable.
2024-03-13 23:45:58 +01:00
7da9c71983
Replace docker-compose with docker in GitHub Workflow
The GitHub Workflow (docker.yml) has been refactored to replace docker-compose with docker. This involves changes in the installation instructions and the commands to build and test the Docker image. This simplifies the workflow and allows the use of standard Docker commands instead of docker-compose.
2024-03-13 23:41:01 +01:00
7ee5632405
Refactor docker-compose installation in GitHub Workflow
Docker-compose installation has been moved in the GitHub Workflow (docker.yml) from the "test" to the "build" phase. This change ensures docker-compose is installed early on, making it available throughout the entire process. The steps include updating the package list, installing docker-compose, and confirming its installation.
2024-03-13 23:37:38 +01:00
a9b0f3b32b
Add docker-compose installation to GitHub Workflow
The GitHub Workflow (docker.yml) now includes a step for installing docker-compose. This addition ensures that docker-compose is available within the Docker container, which is necessary for performing complex multi-container tasks. The installation process involves updating the package list, installing docker-compose, and verifying its location.
2024-03-13 23:36:37 +01:00
6987fdd8af
Relocate Docker build and push process to GitHub Workflow
The Docker image creation and pushing procedures have been moved from the goreleaser.yaml file to a separate GitHub Workflow file docker.yml. This shift gives a more granular control over the Docker image build and push operations with specific GitHub Actions. Also, added the Dockerfile instructions and docker-files for image building to cope up with the changed Docker process.
2024-03-13 23:34:23 +01:00
b9d48ffd15 Updated .goreleaser 2024-03-13 23:23:09 +01:00
53a9410f4c Updated .goreleaser config 2024-03-13 23:15:12 +01:00
2100a2a227 Added cosign key 2024-03-13 23:05:16 +01:00
45696a70f8 Merge pull request 'More release options' (#57) from feat/more_release_options into main
Reviewed-on: #57
2024-03-13 22:59:53 +01:00