AIASM-14: verify multi-class entity validation for NHI combinations#1202
Closed
jmountifield wants to merge 2 commits into
Closed
AIASM-14: verify multi-class entity validation for NHI combinations#1202jmountifield wants to merge 2 commits into
jmountifield wants to merge 2 commits into
Conversation
Pin the SDK's existing multi-class behavior with NHI as a secondary class. Covers AIASM-14 BDD scenarios: - 14.1/14.2 — User+NHI and AccessKey+NHI multi-class entities created via createIntegrationEntity preserve both primary-class properties (username, fingerprint, etc.) and NHI metadata (_nhiType, _isAi, …). - 14.3 — createMultiClassEntityMetadata accepts an NHI typebox alongside typeboxClassSchemaMap entries, produces a JSON schema with $refs to both classes, and the resulting createEntity output validates cleanly. - 14.4 — toMatchDataModelSchema passes for a User+NHI entity when the NHI schema is registered with the validator singleton. - 14.5 — schemaWhitelistedPropertyNames unions properties across all classes in the array, including the NHI metadata set, for the five combinations called out in the implementation notes (User, AccessKey, Application, Certificate, Secret + NHI). NHI is registered inline in each test file because @jupiterone/data-model 0.62.0 does not yet ship NHI; publishing the schema is AIASM-15. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…Entity owner Tracks data-model PR #104 review: - Inline NHI schemas in all three test files now use bare property names (nhiType, isAi, aiConfidence, aiPlatform, nhiOwnerStatus) matching the data-model NHI.json convention. Underscore prefix is reserved for system-managed fields (_class, _type, _key). - Drop the _nhiOwner property entirely. The data-model schema redeclares Entity's existing `owner` field with an NHI-specific description rather than introducing a separate property — the inline test fixtures now match that shape. - Update test data and assertions accordingly. NHI_PROPERTIES whitelist array drops _nhiOwner. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author
|
Closing — see AIASM-14 for rationale. The verification work confirmed the SDK already supports multi-class _class: ['User', 'NHI'] (etc.) without any code changes. With AIASM-15 closed (live service is now the runtime source of truth for NHI), the regression-test value here has reduced. The branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Verification-only PR pinning the SDK's existing multi-class behavior with NHI as
a secondary class. No source changes — adds 3 test files (+501 lines) covering
the BDD scenarios from AIASM-14.
User+NHIvalidates against both class schemascreateIntegrationHelpers.test.ts(helper + EntityValidator),createIntegrationEntity.test.tsAccessKey+NHIvariantcreateIntegrationEntity.test.ts,createIntegrationHelpers.test.tscreateMultiClassEntityMetadataworks with NHIcreateIntegrationHelpers.test.ts(User+NHI and AccessKey+NHI helpers, validating the produced JSON Schema)toMatchDataModelSchemavalidates NHI multi-classjest.test.ts(testing pkg)createIntegrationEntity.test.ts(schemaWhitelistedPropertyNamestest.each overUser,AccessKey,Application,Certificate,Secret× NHI; pluscreateIntegrationEntitypreservation tests for each combo)Why
schemaWhitelistedPropertyNamesalready unions properties across all classes in_class[], andcreateMultiClassEntityMetadataalready builds anallOfJSONSchema with
$refsto each class. The deliverable per the ticket'simplementation notes is "a test suite proving it" — this is that suite.
Notes
dataModel.IntegrationSchema.addSchema()in eachtest, because
@jupiterone/data-model@0.62.0does not yet ship NHI.Publishing is AIASM-15.
dataModelsingleton and thegetValidatorSync()validator instance so the$refresolves and the validator can compile.firstName,lastName,email[], …) are rigidfor service accounts in the wild — flagged in test comments as a data-model
concern outside AIASM-14 scope.
Test plan
integration-sdk-corejest 144/144 greenintegration-sdk-testingjest 105/105 greentsc --noEmitclean across both packages🤖 Generated with Claude Code