Repository navigation
Releases
Releases · NCodeGroup/PasswordGenerator
v2.0.0
Added
- Public API tracking with
PublicAPI.Shipped.txtandPublicAPI.Unshipped.txt; the public API of v1.0.1 is recorded as shipped and is unchanged. - Every pack validates the package against the last published version, 1.0.1, so a change that breaks its public API fails the build.
- The package declares itself trim- and Native AOT-compatible (
IsAotCompatible), so the build reports any change that would break a trimmed or AOT-compiled app. (#24) IPasswordGenerator.GeneratePinnedreturns a password in a buffer on the pinned object heap, which the garbage collector never copies, and zeroes it when disposed, so an application can clear a password after use; the overloads take the default options, a callback that adjusts them, or options passed in. AnIPasswordGeneratorimplemented outside the library throwsNotSupportedExceptionfrom them until it overrides them. (#37, ADR-1001)PasswordGeneratorOptions.ExcludedCharactersandSetExcludedCharacterskeep the characters they list out of every character class, so no generated password contains them, andIsValidrejects a password that holds one;PasswordGeneratorOptions.AmbiguousCharactersis0O1Il|, the look-alike characters to pass to it. Generating with a minimum above zero for a class whose characters are all excluded throwsArgumentException.PasswordGeneratorOptions.EstimateEntropyBits(int length)estimates the strength, in bits, of a password of that length generated with the options: the length times the base-2 logarithm of the number of distinct characters inCharacterSet, an upper bound, since the minimum counts and the run limit narrow the choices.- The package's readme,
src/NCode.PasswordGenerator/README.md, which nuget.org shows: installation, dependency injection and configuration binding, everyGenerateandGeneratePinnedoverload, each option with its default, the exceptions each member throws, and the entropy estimate, with links and badges that work on nuget.org. tests/NCode.PasswordGenerator.Tests/README.mdsays what the test project covers, how to run its tests and how to write new ones.
Changed
AssemblyVersionmoves only with the major version: 2.0.0 and every later 2.x release carry2.0.0.0, so a minor or patch upgrade is a drop-in replacement;FileVersionandInformationalVersionkeep the exact version. Releases up to 1.0.1 had anAssemblyVersionequal to the package version. (#24)- Updated the project to project-template v0.61.2: stricter analyzers and banned APIs, a Definition of Done build script, and CI that runs it.
- Moved the library project to
src/NCode.PasswordGenerator/and the test project totests/NCode.PasswordGenerator.Tests/, the layout the project template uses; the package and its public API are unchanged. - Updated the project to project-template v0.114.1: the version of every assembly and package comes from
version.jsonthrough Nerdbank.GitVersioning, so a release's tag must name the versionversion.jsonholds, and the release workflow fails when it doesn't; NCode Review approves a clean pull request, and pull requests open as drafts; the project gains a code of conduct, governance, roadmap, architecture and assurance case documents. - Passwords are filled and shuffled with
RandomNumberGenerator.GetItemsandRandomNumberGenerator.Shuffle, andPasswordGeneratorOptions.IsValidlooks up special characters withSearchValues<char>; the rules a generated password meets are unchanged. (#24) - Breaking: Generating a password with
MinSpecialCharactersabove zero and an emptySpecialCharactersthrowsArgumentExceptioninstead of its subclassArgumentOutOfRangeException; code that catchesArgumentOutOfRangeExceptionfor this case must catchArgumentExceptioninstead. (#24) - Packages are published to nuget.org by
.github/workflows/publish.ymlthrough nuget.org trusted publishing, from the protectednugetenvironment and with no long-lived API key, and each release carries build provenance and an SBOM;.github/workflows/raise-baseline.ymlraises the package validation baseline after each release. (#11, #32, #40) - Each release is tagged, published as a GitHub release and pushed to nuget.org as its pull request merges into
main:AGENTS.md's Landing section setsrelease: tag+release, so.github/workflows/tag-release.ymltags the version of the changelog's newest section and starts.github/workflows/publish.yml. - Every C# file starts with the two-line SPDX header,
// Copyright © NCode Groupand// SPDX-License-Identifier: Apache-2.0, and the Rider settings generate it. (#38) - The solution is
NCode.PasswordGenerator.slnx, the build settings the project template already makes are no longer repeated, and no file starts with a UTF-8 byte order mark; the package's contents, Source Link and symbols are unchanged. (#30) - Breaking:
AddPasswordGeneratorvalidates the options when the host starts, and whenIOptions<PasswordGeneratorOptions>is first read, and throwsOptionsValidationExceptionnaming each problem for options that can't generate a password: every minimum count at zero,MinLengthbelow 1,MinLengthaboveMaxLength, minimum counts that add up to more thanMaxLength,MaxAttemptsorMaxConsecutiveIdenticalCharactersbelow 1, or a character class with a minimum above zero and no character left to choose from. Fix the options it names; such a host otherwise failed when it generated a password. (ADR-1002) - Breaking:
PasswordGeneratorOptions.SetLengthRangethrowsArgumentOutOfRangeExceptionforminLength, with the message "minLength cannot be greater than maxLength.", whenminLengthis greater thanmaxLength, instead of anInvalidOperationExceptionwith no message; code that catchesInvalidOperationExceptionfrom it must catchArgumentOutOfRangeExceptioninstead. (#46, ADR-1003) - The repository's
README.mdis a landing page: CI, NuGet and OpenSSF Scorecard badges, requirements, installation, a quick start, the repository's layout and how to build from source; it links to the package's readme for the full guide. - Breaking: The
PasswordGeneratorOptions.MinLengthandMaxLengthsetters accept any value, so binding a configuration section such as{ "MinLength": 80, "MaxLength": 100 }sets both bounds instead of throwingArgumentOutOfRangeExceptionwhileMaxLengthstill holds its default of 64. Options whoseMinLengthis greater thanMaxLengthfailAddPasswordGenerator's validation withOptionsValidationException, andGenerateandGeneratePinnedthrowInvalidOperationException("MinLength cannot be greater than MaxLength.") for them; code that relied on a setter to reject an inverted range callsSetLengthRange(min, max), which still throwsArgumentOutOfRangeException. (#51, ADR-1004)
Removed
- Breaking: Support for .NET Standard 2.1. The package targets .NET 10 (
net10.0) only and is released as 2.0.0; apps on .NET 6–9, Unity, Mono or Xamarin stay on the 1.x packages. The public API is unchanged, so a .NET 10 app upgrades without code changes. (#24, ADR-1000) .github/workflows/main.ymland itsbuild/Test-PackageVersion.ps1checks:.github/workflows/ci.ymlbuilds and tests every change, and the README's badge shows it. (#32, #11)
Fixed
- The NuGet package has its description and tags, which were set in a file the build never read. (#22)
- The
Span<char>overloads ofGenerateclear the caller's buffer before they throwInvalidOperationException("Too many attempts."), so the last rejected attempt isn't left in it. (#36) - The documentation of
IPasswordGeneratorsays enumerating it yieldsMaxEnumerationspasswords, 100 by default, instead of an infinite sequence. (#29) - Breaking: The
Generateoverloads that return astringthrowInvalidOperationException("The requested password length is too small.") when the length drawn from the options is 0 or less, instead of returning an empty string that was never validated (a length of 0) or throwingArgumentOutOfRangeException(a negative length);GeneratePinneddoes the same. KeepMinLengthat 1 or more, or catchInvalidOperationException. (#28) - The default special characters hold
;once instead of twice, so;is no more likely than any other special character; the default set of chara...