Portable SCIM 2.0 schema, filter, patch, query, and bulk semantics for MoonBit
git clone https://github.com/binhongcha/MoonSCIM.git
cd MoonSCIM
moon check --target all --deny-warn
moon test --target all --deny-warn
moon run examples/saas_provisioning --target nativelet resource = @codec.decode_object(json_text).unwrap()
let report = @validation.validate_resource(
@standard.standard_registry(),
@standard.user_schema_id(),
resource,
@validation.Create,
)
if report.is_valid() {
let filter = @filter.compile_filter(
"active eq true and emails[type eq \"work\"].value co \"@example.com\"",
).unwrap()
println(filter.matches(resource))
}let updated = @patch.apply_patch(resource, [
@patch.replace("active", @value.boolean(false)),
@patch.remove("title"),
]).unwrap()moon run cmd/main --target native -- version
moon run cmd/main --target native -- discover
moon run cmd/main --target native -- validate '{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User"],"userName":"alice"}'
moon run cmd/main --target native -- match 'active eq true' '{"active":true}'moon run examples/saas_provisioning --target native
moon run examples/hr_lifecycle --target native
moon run examples/group_sync --target native
moon run benchmarks/query_10k --target native| Package | Responsibility |
|---|---|
| value | Immutable JSON-shaped values and case-insensitive objects |
| path | SCIM attribute and extension-URN paths |
| schema / standard | Schema metadata, registry, built-in resources |
| validation | Resource and transition diagnostics |
| filter | Compile and evaluate SCIM filters and value paths |
| patch | Atomic SCIM PATCH transformations |
| query | Projection, sorting, index and cursor pagination |
| bulk | Bulk validation, dependency planning, bulkId resolution |
| codec | Bounded deterministic JSON conversion |
| protocol | Response envelopes and discovery resources |
| Area | v0.1 status | Deliberate boundary |
|---|---|---|
| RFC 7643 core resource model | Implemented | Host assigns IDs, timestamps, and versions |
| RFC 7644 filters | Implemented | String matching is case-insensitive unless a host adds schema-aware comparison |
| RFC 7644 PATCH | Implemented | Operates on in-memory resources; persistence is external |
| RFC 7644 Bulk | Planning/resolution implemented | HTTP execution, rollback, and rate limits are external |
| RFC 7644 discovery/messages | Implemented value builders | Routing and content negotiation are external |
| RFC 7644 index pagination | Implemented | Storage push-down is an adapter concern |
| RFC 9865 cursor pagination | Implemented continuation model | Built-in token is not a MAC; sign/encrypt at trust boundaries |
| RFC 9944 device schemas | Not yet implemented | Planned extension package |
| RFC 9967 SCIM events | Not yet implemented | Requires event transport and security profile |
moon fmt --check
moon check --target all --deny-warn
moon test --target all --deny-warn
moon build --target native --deny-warn
moon info
python tools/count_moonbit_loc.py --minimum 4000Install
Download zipPortable SCIM 2.0 schema, filter, patch, query, and bulk semantics for MoonBit