Skip to content

Commit b9e5d26

Browse files
shakeyourbunnyshakeyourbunnymvadu
authored
Upgrade to v3.0.0, thanks to @shakeyourbunny
* v3.0.0: Hard fork — security hardening, modernization, namespace rename Hard fork from AdysTech/CredentialManager. Upstream MIT attribution preserved. Security: - Replace BinaryFormatter with System.Text.Json (CWE-502) - Fix persistence hardcoded to Enterprise (#69), default to LocalMachine - JIT-safe memory zeroing via RtlZeroMemory P/Invoke - Fix P/Invoke SetLastError, buffer size constants Modernization: - Rename namespace/package to shakeyourbunny.CredentialManager - New signing key, new solution GUIDs - Drop net45, add net8.0, keep netstandard2.0 - C# 12, nullable reference types, file-scoped namespaces - i18n resource files (en/de/fr/es/it) - Remove upstream AppVeyor CI config Tests: - Persistence parameter, JSON round-trips, null parameter handling - Test category renamed from AppVeyor to CI * v3.1.0: Analyzer hardening, NuGet readiness, documentation overhaul 6 Roslyn analyzer suites (Microsoft.CodeAnalysis.NetAnalyzers, StyleCop, SecurityCodeScan, Roslynator, SonarAnalyzer, Meziantou.Analyzer) with zero warnings across ~2,000+ combined rules. Zero SecurityCodeScan findings confirms no OWASP vulnerabilities. Code fixes: CA2208 exception types, MA0002 StringComparer.Ordinal, MA0006 string.Equals, S1172 unused parameter, S1854 useless assignment, S108 empty catch blocks. P/Invoke conventions properly suppressed. NuGet package: README included, search tags, release notes, Source Link, symbol package. Demo application exercises full API surface. Automated build pipeline with interactive credential store testing via schtasks. README rewritten as standalone project documentation with integration guide, API reference, and migration instructions. * upstream-pr: rebase to AdysTech namespace, remove strong-naming Prepares a PR-ready branch for AdysTech/CredentialManager (issue #71). Carries the full v3.0.0→v3.1.0 feature set (security hardening, C# 12, .NET 8.0, nullable annotations, 6 Roslyn analyzer suites, i18n, Source Link, demo app) onto the upstream namespace and repo identity. Changes: - Rename src/shakeyourbunny.CredentialManager/ → src/AdysTech.CredentialManager/ - Rename shakeyourbunny.CredentialManager.csproj → AdysTech.CredentialManager.csproj - Update namespace declarations in all 9 source files - Update ResourceManager base name in SR.cs - Update using statements in test and demo projects - Update project references in test/demo .csproj files - Update CredentialManager.sln project entry - Directory.Build.props: update URLs, copyright, authors; remove signing props - AssemblyInfo.cs: simplify InternalsVisibleTo (no public key, no strong name) - Remove key.snk (fork-specific; upstream can add their own key if desired) - README.md: AdysTech namespace/package, remove fork migration guide - CHANGELOG.md: reframe v3.0.0 as security/modernization release, not hard fork --------- Co-authored-by: shakeyourbunny <shakeyourbunny@gmail.com> Co-authored-by: Adarsha <8618235+mvadu@users.noreply.github.com>
1 parent 22c751a commit b9e5d26

31 files changed

Lines changed: 3379 additions & 1679 deletions

.editorconfig

Lines changed: 184 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,186 @@
1-
[*.cs]
1+
root = true
22

3-
# IDE0008: Use explicit type
4-
csharp_style_var_elsewhere = false:suggestion
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
59

6-
# IDE0018: Inline variable declaration
7-
csharp_style_inlined_variable_declaration = false:suggestion
10+
[*.{xml,json,yml,yaml,resx,props,targets,csproj}]
11+
indent_size = 2
12+
13+
[*.cs]
14+
csharp_style_namespace_declarations = file_scoped:warning
15+
csharp_style_var_for_built_in_types = false:suggestion
16+
csharp_style_var_when_type_is_apparent = true:suggestion
17+
csharp_prefer_braces = when_multiline:suggestion
18+
dotnet_sort_system_directives_first = true
19+
20+
# ============================================================
21+
# .NET Analyzers (CA rules)
22+
# ============================================================
23+
24+
# Globalization: Windows Credential Store is not globalized
25+
dotnet_diagnostic.CA1303.severity = none
26+
dotnet_diagnostic.CA1304.severity = none
27+
dotnet_diagnostic.CA1305.severity = none
28+
dotnet_diagnostic.CA1307.severity = none
29+
dotnet_diagnostic.CA1310.severity = none
30+
31+
# CA1401: P/Invokes should not be visible — ours are internal
32+
dotnet_diagnostic.CA1401.severity = warning
33+
34+
# CA1416: Platform compatibility — library IS Windows-only
35+
dotnet_diagnostic.CA1416.severity = suggestion
36+
37+
# CA1720: Identifier contains type name — "blob" fields are fine
38+
dotnet_diagnostic.CA1720.severity = none
39+
40+
# CA1711: Identifiers should not have incorrect suffix
41+
dotnet_diagnostic.CA1711.severity = none
42+
43+
# CA1724: Type names should not match namespaces — CredentialManager is correct
44+
dotnet_diagnostic.CA1724.severity = none
45+
46+
# CA1060: Move P/Invokes to NativeMethods — NativeCode is equivalent
47+
dotnet_diagnostic.CA1060.severity = none
48+
49+
# CA1510: ThrowIfNull — .NET 6+ only, not available in netstandard2.0
50+
dotnet_diagnostic.CA1510.severity = none
51+
52+
# CA1707: Identifiers should not contain underscores — P/Invoke enums use Win32 naming
53+
dotnet_diagnostic.CA1707.severity = none
54+
55+
# CA1815: Override equals on value types
56+
dotnet_diagnostic.CA1815.severity = warning
57+
58+
# CA1838: StringBuilder in P/Invoke — established Win32 API calling convention
59+
dotnet_diagnostic.CA1838.severity = none
60+
61+
# CA1852: Seal internal types
62+
dotnet_diagnostic.CA1852.severity = warning
63+
64+
# CA1863: CompositeFormat — .NET 8+ only, not available in netstandard2.0
65+
dotnet_diagnostic.CA1863.severity = none
66+
67+
# CA1869: Cache Regex instances
68+
dotnet_diagnostic.CA1869.severity = warning
69+
70+
# CA2101: Marshalling for P/Invoke string arguments
71+
dotnet_diagnostic.CA2101.severity = warning
72+
73+
# ============================================================
74+
# StyleCop (SA rules)
75+
# ============================================================
76+
# The library uses P/Invoke conventions (Win32 struct/enum naming,
77+
# explicit type names in marshalling). StyleCop's C# style rules
78+
# conflict with these established Windows API conventions.
79+
# We keep meaningful SA rules and suppress cosmetic ones.
80+
81+
# SA0001: XML comment analysis disabled — no XML doc generation
82+
dotnet_diagnostic.SA0001.severity = none
83+
84+
# --- Spacing & layout (cosmetic) ---
85+
dotnet_diagnostic.SA1000.severity = none
86+
dotnet_diagnostic.SA1005.severity = none
87+
dotnet_diagnostic.SA1009.severity = none
88+
dotnet_diagnostic.SA1011.severity = none
89+
dotnet_diagnostic.SA1101.severity = none
90+
dotnet_diagnostic.SA1111.severity = none
91+
dotnet_diagnostic.SA1116.severity = none
92+
dotnet_diagnostic.SA1117.severity = none
93+
dotnet_diagnostic.SA1119.severity = none
94+
dotnet_diagnostic.SA1122.severity = none
95+
dotnet_diagnostic.SA1128.severity = none
96+
dotnet_diagnostic.SA1131.severity = none
97+
dotnet_diagnostic.SA1133.severity = none
98+
dotnet_diagnostic.SA1200.severity = none
99+
dotnet_diagnostic.SA1413.severity = none
100+
dotnet_diagnostic.SA1501.severity = none
101+
dotnet_diagnostic.SA1503.severity = none
102+
103+
# --- Blank line rules (cosmetic) ---
104+
dotnet_diagnostic.SA1507.severity = none
105+
dotnet_diagnostic.SA1510.severity = none
106+
dotnet_diagnostic.SA1512.severity = none
107+
dotnet_diagnostic.SA1513.severity = none
108+
dotnet_diagnostic.SA1515.severity = none
109+
dotnet_diagnostic.SA1516.severity = none
110+
111+
# --- Element ordering (cosmetic) ---
112+
dotnet_diagnostic.SA1201.severity = none
113+
dotnet_diagnostic.SA1202.severity = none
114+
dotnet_diagnostic.SA1204.severity = none
115+
dotnet_diagnostic.SA1206.severity = none
116+
dotnet_diagnostic.SA1208.severity = none
117+
dotnet_diagnostic.SA1210.severity = none
118+
119+
# --- Naming: P/Invoke structs use Win32 conventions (CREDENTIAL, cbSize, etc.) ---
120+
dotnet_diagnostic.SA1121.severity = none
121+
dotnet_diagnostic.SA1303.severity = none
122+
dotnet_diagnostic.SA1304.severity = none
123+
dotnet_diagnostic.SA1307.severity = none
124+
dotnet_diagnostic.SA1308.severity = none
125+
dotnet_diagnostic.SA1309.severity = none
126+
dotnet_diagnostic.SA1310.severity = none
127+
dotnet_diagnostic.SA1311.severity = none
128+
dotnet_diagnostic.SA1312.severity = none
129+
dotnet_diagnostic.SA1313.severity = none
130+
131+
# --- Access modifiers ---
132+
dotnet_diagnostic.SA1400.severity = none
133+
134+
# --- Documentation: keep for public API ---
135+
dotnet_diagnostic.SA1600.severity = warning
136+
dotnet_diagnostic.SA1602.severity = suggestion
137+
dotnet_diagnostic.SA1649.severity = warning
138+
139+
# --- File header rules — not used ---
140+
dotnet_diagnostic.SA1633.severity = none
141+
dotnet_diagnostic.SA1634.severity = none
142+
dotnet_diagnostic.SA1635.severity = none
143+
dotnet_diagnostic.SA1636.severity = none
144+
dotnet_diagnostic.SA1637.severity = none
145+
dotnet_diagnostic.SA1638.severity = none
146+
dotnet_diagnostic.SA1639.severity = none
147+
dotnet_diagnostic.SA1640.severity = none
148+
dotnet_diagnostic.SA1641.severity = none
149+
150+
# ============================================================
151+
# SonarAnalyzer (S rules)
152+
# ============================================================
153+
154+
# S101: Pascal case naming — CredentialAPIException is established API name
155+
dotnet_diagnostic.S101.severity = none
156+
157+
# S2344: Enum suffix 'Flags' — P/Invoke enums mirror Win32 naming
158+
dotnet_diagnostic.S2344.severity = none
159+
160+
# S3267: Simplify loop to LINQ — marshal cleanup requires explicit loop
161+
dotnet_diagnostic.S3267.severity = none
162+
163+
# S3925: ISerializable pattern — guarded by #if, not applicable on net8.0
164+
dotnet_diagnostic.S3925.severity = none
165+
166+
# ============================================================
167+
# Meziantou (MA rules)
168+
# ============================================================
169+
170+
# MA0011: IFormatProvider — format strings here are internal diagnostics, not user-facing
171+
dotnet_diagnostic.MA0011.severity = none
172+
173+
# MA0016: Return IList<> instead of List<> — would be a public API breaking change
174+
dotnet_diagnostic.MA0016.severity = none
175+
176+
# MA0048: File name must match type name — PublicEnums.cs groups related enums by design
177+
dotnet_diagnostic.MA0048.severity = none
178+
179+
# MA0049: Type name should not match namespace — CredentialManager IS the correct name
180+
dotnet_diagnostic.MA0049.severity = none
181+
182+
# MA0051: Method too long — SaveCredential is complex but cohesive (P/Invoke marshalling)
183+
dotnet_diagnostic.MA0051.severity = none
184+
185+
[*.sln]
186+
indent_style = tab

.gitattributes

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# default for csharp files.
1111
# Note: This is only used by command line
1212
###############################################################################
13-
#*.cs diff=csharp
13+
*.cs diff=csharp
1414

1515
###############################################################################
1616
# Set the merge driver for project and solution files
@@ -35,29 +35,3 @@
3535
#*.sqlproj merge=binary
3636
#*.wwaproj merge=binary
3737

38-
###############################################################################
39-
# behavior for image files
40-
#
41-
# image files are treated as binary by default.
42-
###############################################################################
43-
#*.jpg binary
44-
#*.png binary
45-
#*.gif binary
46-
47-
###############################################################################
48-
# diff behavior for common document formats
49-
#
50-
# Convert binary document formats to text before diffing them. This feature
51-
# is only available from the command line. Turn it on by uncommenting the
52-
# entries below.
53-
###############################################################################
54-
#*.doc diff=astextplain
55-
#*.DOC diff=astextplain
56-
#*.docx diff=astextplain
57-
#*.DOCX diff=astextplain
58-
#*.dot diff=astextplain
59-
#*.DOT diff=astextplain
60-
#*.pdf diff=astextplain
61-
#*.PDF diff=astextplain
62-
#*.rtf diff=astextplain
63-
#*.RTF diff=astextplain

0 commit comments

Comments
 (0)