Skip to content

No test covers the encryption round-trip; existing context test cannot catch the bug #56

Open

Description

@brinehart

File: core/csharp/MicroZen.Api.Test/Context/MicroZenContextTests.cs

What this is: The reference test persists an Organization and reads it back.

Problem: It only checks unencrypted fields of an entity that has no [EncryptColumn] properties, so the inverted-encryption bug (see the "Encryption is inverted" Must Fix issue) sails through green. No test ever round-trips an OAuth2ClientCredentials secret through the converter.

Fix: Add a test that saves an OAuth2ClientCredentials, reads the raw stored value, and asserts the secret is NOT readable plaintext while the name IS — this fails today and would have caught the inverted-encryption bug.

If we skip it: The most dangerous bug stays invisible to CI.

Activity

  1. added
    Should FixRisky code without a test, real slowness, duplication, or code that should not exist
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Should FixRisky code without a test, real slowness, duplication, or code that should not exist

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions