Part of the Kopexa GRC Platform
Shared test fixtures for Kopexa Resource Names (KRN) packages across different languages.
This repository contains language-agnostic test cases that ensure compatibility between:
- Go: github.com/kopexa-grc/krn
- TypeScript: @kopexa/krn
# Add to your project
git submodule add https://github.com/kopexa-grc/krn-fixtures.git fixtures
# Update to latest
git submodule update --remote fixturestestcases.json # All test cases
schema.json # JSON Schema for validation
- valid: KRN strings that should parse successfully with expected properties
- invalid: KRN strings that should fail with specific error codes
KRN strings where parse(input).toString() === input must hold true.
Test cases for validation functions:
isValidResourceIdisValidVersionisValidService
Test cases for the safeResourceId sanitization function.
Test cases for KRN operations:
parent()- Get parent KRNwithVersion()/withoutVersion()withService()/withoutService()child()- Create child KRNresourceId()- Get resource ID by collection
All implementations must support these error codes:
| Code | Description |
|---|---|
EMPTY_KRN |
Empty input string |
INVALID_KRN |
Malformed KRN structure |
INVALID_DOMAIN |
Wrong domain or invalid service name |
INVALID_RESOURCE_ID |
Invalid resource ID format |
INVALID_VERSION |
Invalid version format |
RESOURCE_NOT_FOUND |
Collection not found in KRN |
- Update
testcases.jsonwith new test cases - Ensure schema validation passes
- Update all language implementations to pass new tests
- Submit PR
- github.com/kopexa-grc/krn - Go implementation (source of truth)
- @kopexa/krn - TypeScript implementation
Kopexa is a modern GRC (Governance, Risk, and Compliance) platform that helps organizations manage their compliance requirements efficiently.
- Website: kopexa.com
- Documentation: docs.kopexa.com
Copyright (c) Kopexa GRC
Licensed under the Apache License, Version 2.0.