Class ScimServiceProvider
java.lang.Object
com.revetsec.scim.ScimServiceProvider
Immutable framework-neutral SCIM schema, request and response primitives. Applications authenticate,
authorize, execute queries and persist candidates atomically; this facade performs no I/O.
Each direct-result operation has one bounded work budget and redacted observer lifecycle.
Parsed carriers are tied to this registration and compatibility snapshot. Base-URI-only copies
share that semantic registration; changed compatibility requires fresh parsing.
Resource-type arguments must be the exact immutable objects registered with this provider,
rather than separately constructed equal definitions. Passing a foreign trusted type is a
programming error; expected untrusted-input failures return checked fixed rejections.
Original query/header occurrences must reach these operations before framework normalization.
A prepared response proves bounded output only. Applications prepare the final authorized
candidate before commit where preparation can fail, then emit it only after confirmed persistence.
- Since:
- 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable complete provider configuration; null restores each documented default.static final classMutable provider copy. -
Method Summary
Modifier and TypeMethodDescriptionapplyPatchResult(@NonNull ScimResource current, @NonNull ScimPatchRequest patch) Applies every ordered operation to an immutable candidate, publishing only after final validation.builder()Starts configuration with no resource registrations; PATCH, filter, sort and password-change advertisement are disabled, and ETags are enabled.checkIfMatchResult(@NonNull List<@NonNull String> rawHeaderValues, @NonNull ScimResource current) Checks weak opaque-version If-Match against the existing resource, deliberately differing from general HTTP strong comparison.checkIfNoneMatchResult(@NonNull List<@NonNull String> rawHeaderValues, @NonNull ScimResource current) Checks original conditional-read tags against the authoritative existing resource using weak opaque-version comparison.copy()Starts a copy retaining the current semantic registration unless compatibility changes.createdResponseResult(@NonNull ScimResource created, @NonNull Set<@NonNull ScimAttributePath> suppliedPaths, @NonNull ScimAttributeSelection selection) Prepares creation from the final authorized candidate with authoritative ID and metadata.errorResponse(@NonNull ScimError error) Returns a fixed bounded error without including request data or causes.Returns the trusted canonical trailing-slash base URI.Returns the explicit compatibility features.Returns the immutable configured filter policies.Returns the processing limits.Returns the immutable registered resource types.Returns the advertised capabilities.Returns the optional application matching strategy.Prepares a truthful index or cursor ListResponse from an application-produced page.Returns the fixed bounded no-content response.Prepares a bounded bodyless conditional read response with current ETag when enabled.parseAttributeSelectionResult(@NonNull ScimResourceType resourceType, @NonNull String rawQuery) Parses a bound projection from the original raw query, separately from caller authorization.parseFilterResult(@NonNull ScimResourceType resourceType, @NonNull String expression) Parses, binds and approves the complete normalized filter under the configured policy.parsePatchRequestResult(@NonNull ScimResourceType resourceType, byte @NonNull [] body) Parses PATCH bytes whose transport framing and media type were already validated.parsePatchRequestResult(@NonNull ScimResourceType resourceType, @NonNull List<@NonNull String> contentTypeHeaderValues, byte @NonNull [] body) Parses ordered PATCH operations after validating original media-type fields.parseQueryResult(@NonNull ScimResourceType resourceType, @NonNull String rawQuery) Parses a raw GET collection query with strict bounded decoding and complete filter approval.parseReplacementResult(@NonNull ScimResourceType resourceType, @NonNull ScimResource current, byte @NonNull [] body) Parses a replace body whose HTTP framing and media type were already validated.parseReplacementResult(@NonNull ScimResourceType resourceType, @NonNull ScimResource current, @NonNull List<@NonNull String> contentTypeHeaderValues, byte @NonNull [] body) Parses a replace body after validating original media-type fields.parseResourceResult(@NonNull ScimResourceType resourceType, byte @NonNull [] body) Parses a create body whose HTTP framing and media type were already validated.parseResourceResult(@NonNull ScimResourceType resourceType, @NonNull List<@NonNull String> contentTypeHeaderValues, byte @NonNull [] body) Parses a create body after validating original media-type fields.parseSearchRequestResult(@NonNull ScimResourceType resourceType, byte @NonNull [] body) Parses a search body whose HTTP framing and media type were already validated.parseSearchRequestResult(@NonNull ScimResourceType resourceType, @NonNull List<@NonNull String> contentTypeHeaderValues, byte @NonNull [] body) Parses a search body after validating original media-type fields.patchResponseResult(@NonNull ScimResource persistedCandidate, @NonNull Set<@NonNull ScimAttributePath> suppliedPaths, @NonNull ScimAttributeSelection selection) Prepares the final authorized PATCH candidate after application-assigned authoritative metadata.Reduces supported standard Group membership operations into ordered ID steps without reading storage.replacementResponseResult(@NonNull ScimResource replaced, @NonNull Set<@NonNull ScimAttributePath> suppliedPaths, @NonNull ScimAttributeSelection selection) Prepares a replacement response from the final authorized candidate with authoritative metadata.resourceLocationFor(@NonNull ScimResourceType resourceType, @NonNull String authoritativeId) Encodes an authoritative ID as one path segment beneath the trusted type endpoint.resourceResponseResult(@NonNull ScimResource resource, @NonNull ScimAttributeSelection selection) Prepares a GET resource response without write provenance.resourceTypeResponseResult(@NonNull String resourceTypeName, @NonNull String rawQuery) Prepares bounded discovery with projection; discovery filters reject.resourceTypesResponseResult(@NonNull String rawQuery) Prepares bounded discovery with projection; discovery filters reject.schemaResponseResult(@NonNull String schemaId, @NonNull String rawQuery) Prepares bounded discovery with projection; discovery filters reject.schemasResponseResult(@NonNull String rawQuery) Prepares bounded discovery with projection; discovery filters reject.Prepares bounded discovery with projection; discovery filters reject.toString()Returns a fixed redacted description.validateContentTypeResult(@NonNull List<@NonNull String> rawHeaderValues) Validates exactly one original physical media-type header occurrence.
-
Method Details
-
builder
Starts configuration with no resource registrations; PATCH, filter, sort and password-change advertisement are disabled, and ETags are enabled. The application still owns password authorization and handling for a supplied write-onlypasswordvalue.- Returns:
- a new builder
- Since:
- 1.0.0
-
copy
Starts a copy retaining the current semantic registration unless compatibility changes.- Returns:
- a new copier
- Since:
- 1.0.0
-
getBaseUri
Returns the trusted canonical trailing-slash base URI.- Returns:
- the trusted canonical trailing-slash base URI
- Since:
- 1.0.0
-
getResourceTypes
Returns the immutable registered resource types.- Returns:
- the immutable registered resource types
- Since:
- 1.0.0
-
getServiceProviderConfig
Returns the advertised capabilities.- Returns:
- the advertised capabilities
- Since:
- 1.0.0
-
getLimits
Returns the processing limits.- Returns:
- the processing limits
- Since:
- 1.0.0
-
getCompatibility
Returns the explicit compatibility features.- Returns:
- the explicit compatibility features
- Since:
- 1.0.0
-
getStringMatching
Returns the optional application matching strategy.- Returns:
- the optional application matching strategy
- Since:
- 1.0.0
-
getFilterPolicies
Returns the immutable configured filter policies.- Returns:
- the immutable configured filter policies
- Since:
- 1.0.0
-
validateContentTypeResult
public @NonNull ScimContentTypeResult validateContentTypeResult(@NonNull List<@NonNull String> rawHeaderValues) Validates exactly one original physical media-type header occurrence. Accepts application/scim+json or application/json with the selected syntactically valid charset accommodation. Bodies remain strictly UTF-8 regardless of a charset label. Missing, duplicate, malformed or unsupported values reject; do not join physical occurrences before validation.- Parameters:
rawHeaderValues- original physical Content-Type values, including an empty list when absent- Returns:
- the checked direct result
- Since:
- 1.0.0
-
parseFilterResult
public @NonNull ScimFilterParseResult parseFilterResult(@NonNull ScimResourceType resourceType, @NonNull String expression) Parses, binds and approves the complete normalized filter under the configured policy. Syntax alone grants no query permission. Applications execute the returned tree and separately authorize the caller and tenant; this operation executes no storage query.- Parameters:
resourceType- the exact registered resource-type objectexpression- the complete untrusted filter expression- Returns:
- the checked direct result
- Since:
- 1.0.0
-
parseQueryResult
public @NonNull ScimQueryParseResult parseQueryResult(@NonNull ScimResourceType resourceType, @NonNull String rawQuery) Parses a raw GET collection query with strict bounded decoding and complete filter approval. Preserve physical repeated fields; do not first pass through a framework parameter map. Raw plus means space and percent escapes are decoded strictly. Applications own execution, authorization and cursor authenticity/context binding.- Parameters:
resourceType- the exact registered resource-type objectrawQuery- the original undecoded query without a leading question mark, or empty when absent- Returns:
- the checked direct result
- Since:
- 1.0.0
-
parseAttributeSelectionResult
public @NonNull ScimAttributeSelectionResult parseAttributeSelectionResult(@NonNull ScimResourceType resourceType, @NonNull String rawQuery) Parses a bound projection from the original raw query, separately from caller authorization. Preserve physical repeated fields and undecoded text before framework parameter normalization. The returned selection retains this provider's semantic registration.- Parameters:
resourceType- the exact registered resource-type objectrawQuery- the original undecoded query without a leading question mark, or empty when absent- Returns:
- the checked direct result
- Since:
- 1.0.0
-
checkIfMatchResult
public @NonNull ScimIfMatchResult checkIfMatchResult(@NonNull List<@NonNull String> rawHeaderValues, @NonNull ScimResource current) Checks weak opaque-version If-Match against the existing resource, deliberately differing from general HTTP strong comparison. Absence succeeds; an isolated wildcard tests existence. Applications check this exact authoritative resource under the write's lock/version predicate.- Parameters:
rawHeaderValues- original physical If-Match values, or an empty list when absentcurrent- the authoritative existing resource from that transaction- Returns:
- the checked direct result
- Since:
- 1.0.0
-
checkIfNoneMatchResult
public @NonNull ScimIfNoneMatchResult checkIfNoneMatchResult(@NonNull List<@NonNull String> rawHeaderValues, @NonNull ScimResource current) Checks original conditional-read tags against the authoritative existing resource using weak opaque-version comparison. Absence proceeds; an isolated wildcard can report NotModified without a version. Applications own the corresponding GET/HEAD route and read consistency.- Parameters:
rawHeaderValues- original physical If-None-Match values, or an empty list when absentcurrent- the authoritative existing resource- Returns:
- the checked direct result
- Since:
- 1.0.0
-
parseSearchRequestResult
public @NonNull ScimQueryParseResult parseSearchRequestResult(@NonNull ScimResourceType resourceType, @NonNull List<@NonNull String> contentTypeHeaderValues, byte @NonNull [] body) Parses a search body after validating original media-type fields.- Parameters:
resourceType- the exact registered resource-type objectcontentTypeHeaderValues- original physical media-type occurrencesbody- untrusted UTF-8 JSON; empty bytes reject- Returns:
- a checked candidate or fixed error
- Since:
- 1.0.0
-
parseSearchRequestResult
public @NonNull ScimQueryParseResult parseSearchRequestResult(@NonNull ScimResourceType resourceType, byte @NonNull [] body) Parses a search body whose HTTP framing and media type were already validated.- Parameters:
resourceType- the exact registered resource-type objectbody- untrusted UTF-8 JSON; empty bytes reject- Returns:
- a checked candidate or fixed error
- Since:
- 1.0.0
-
parseResourceResult
public @NonNull ScimResourceParseResult parseResourceResult(@NonNull ScimResourceType resourceType, @NonNull List<@NonNull String> contentTypeHeaderValues, byte @NonNull [] body) Parses a create body after validating original media-type fields.- Parameters:
resourceType- the exact registered resource-type objectcontentTypeHeaderValues- original physical media-type occurrencesbody- untrusted UTF-8 JSON; empty bytes reject- Returns:
- a checked candidate or fixed error
- Since:
- 1.0.0
-
parseResourceResult
public @NonNull ScimResourceParseResult parseResourceResult(@NonNull ScimResourceType resourceType, byte @NonNull [] body) Parses a create body whose HTTP framing and media type were already validated.- Parameters:
resourceType- the exact registered resource-type objectbody- untrusted UTF-8 JSON; empty bytes reject- Returns:
- a checked candidate or fixed error
- Since:
- 1.0.0
-
parseReplacementResult
public @NonNull ScimResourceParseResult parseReplacementResult(@NonNull ScimResourceType resourceType, @NonNull ScimResource current, @NonNull List<@NonNull String> contentTypeHeaderValues, byte @NonNull [] body) Parses a replace body after validating original media-type fields.- Parameters:
resourceType- the exact registered resource-type objectcurrent- the immutable authoritative current resourcecontentTypeHeaderValues- original physical media-type occurrencesbody- untrusted UTF-8 JSON; empty bytes reject- Returns:
- a checked candidate or fixed error
- Since:
- 1.0.0
-
parseReplacementResult
public @NonNull ScimResourceParseResult parseReplacementResult(@NonNull ScimResourceType resourceType, @NonNull ScimResource current, byte @NonNull [] body) Parses a replace body whose HTTP framing and media type were already validated.- Parameters:
resourceType- the exact registered resource-type objectcurrent- the immutable authoritative current resourcebody- untrusted UTF-8 JSON; empty bytes reject- Returns:
- a checked candidate or fixed error
- Since:
- 1.0.0
-
parsePatchRequestResult
public @NonNull ScimPatchParseResult parsePatchRequestResult(@NonNull ScimResourceType resourceType, @NonNull List<@NonNull String> contentTypeHeaderValues, byte @NonNull [] body) Parses ordered PATCH operations after validating original media-type fields.- Parameters:
resourceType- the exact registered resource-type objectcontentTypeHeaderValues- original physical media-type occurrencesbody- untrusted UTF-8 PatchOp JSON; empty bytes reject- Returns:
- a schema-bound request or fixed error
- Since:
- 1.0.0
-
parsePatchRequestResult
public @NonNull ScimPatchParseResult parsePatchRequestResult(@NonNull ScimResourceType resourceType, byte @NonNull [] body) Parses PATCH bytes whose transport framing and media type were already validated.- Parameters:
resourceType- the exact registered resource-type objectbody- untrusted UTF-8 PatchOp JSON; empty bytes reject- Returns:
- a schema-bound request or fixed error
- Since:
- 1.0.0
-
applyPatchResult
public @NonNull ScimPatchApplicationResult applyPatchResult(@NonNull ScimResource current, @NonNull ScimPatchRequest patch) Applies every ordered operation to an immutable candidate, publishing only after final validation. Applications authorize attempted and effective paths and persist the candidate atomically.- Parameters:
current- authoritative resource from the application's transactionpatch- schema-bound request from this semantic registration- Returns:
- a complete candidate with change/provenance paths or fixed error
- Since:
- 1.0.0
-
reduceMembershipPatchResult
public @NonNull ScimMembershipPatchResult reduceMembershipPatchResult(@NonNull ScimPatchRequest patch) Reduces supported standard Group membership operations into ordered ID steps without reading storage. Metadata-dependent operations require full evaluation. The application executes all steps and the remainder under one authorization decision and transaction/version predicate.- Parameters:
patch- schema-bound request from this semantic registration- Returns:
- ordered steps, full-evaluation requirement or fixed error
- Since:
- 1.0.0
-
resourceLocationFor
public @NonNull URI resourceLocationFor(@NonNull ScimResourceType resourceType, @NonNull String authoritativeId) Encodes an authoritative ID as one path segment beneath the trusted type endpoint. ASCII letters, digits and-._~remain literal; other UTF-8 bytes use uppercase percent escapes. Standalone.and..identifiers are rejected before encoding. Existing percent escapes in the opaque ID are data, not instructions to decode.- Parameters:
resourceType- the exact registered resource-type objectauthoritativeId- application-assigned identifier- Returns:
- an absolute resource location
- Since:
- 1.0.0
-
resourceResponseResult
public @NonNull ScimResponseResult resourceResponseResult(@NonNull ScimResource resource, @NonNull ScimAttributeSelection selection) Prepares a GET resource response without write provenance.- Parameters:
resource- resource to renderselection- bound projection- Returns:
- a bounded prepared response or fixed error
- Since:
- 1.0.0
-
replacementResponseResult
public @NonNull ScimResponseResult replacementResponseResult(@NonNull ScimResource replaced, @NonNull Set<@NonNull ScimAttributePath> suppliedPaths, @NonNull ScimAttributeSelection selection) Prepares a replacement response from the final authorized candidate with authoritative metadata. Prepare before commit where preparation can fail, and emit only after confirmed persistence. Supplied paths are trusted application provenance from parsing, separately from attempted or modified authorization targets. The bare set has no private parser/configuration proof; its paths are validated against the target schema. Preparation proves neither authorization nor persistence.- Parameters:
replaced- the final application-assigned replacement candidatesuppliedPaths- canonical paths actually supplied, from the resource parse resultselection- the bound projection from this semantic registration- Returns:
- a bounded prepared response or fixed error
- Since:
- 1.0.0
-
createdResponseResult
public @NonNull ScimResponseResult createdResponseResult(@NonNull ScimResource created, @NonNull Set<@NonNull ScimAttributePath> suppliedPaths, @NonNull ScimAttributeSelection selection) Prepares creation from the final authorized candidate with authoritative ID and metadata. Location comes from the trusted base/type endpoint, and any existing meta.location must agree. Prepare before commit where preparation can fail, and emit only after confirmed persistence. Supplied paths are trusted application provenance from parsing, not attempted/modified targets. The bare set has no private parser/configuration proof; its paths are checked against the target schema. Preparation proves neither authorization nor persistence.- Parameters:
created- the final application-assigned creation candidate with an assigned IDsuppliedPaths- canonical paths actually supplied, from the resource parse resultselection- the bound projection from this semantic registration- Returns:
- a bounded prepared response or fixed error
- Since:
- 1.0.0
-
patchResponseResult
public @NonNull ScimResponseResult patchResponseResult(@NonNull ScimResource persistedCandidate, @NonNull Set<@NonNull ScimAttributePath> suppliedPaths, @NonNull ScimAttributeSelection selection) Prepares the final authorized PATCH candidate after application-assigned authoritative metadata. Prepare before commit where preparation can fail, and emit only after confirmed persistence. The resource type's default is used unless either projection parameter was supplied, which forces status 200. Bodyless responses retain authoritative ETag and bounded headers. Supplied paths are trusted application provenance from PATCH application, not attempted/modified authorization targets. The bare set has no private parser/configuration proof; its paths are checked against the target schema. Preparation proves neither authorization nor persistence.- Parameters:
persistedCandidate- the final application-assigned candidate; persistence need not precede preparationsuppliedPaths- canonical paths actually supplied, from the PATCH application resultselection- the bound response projection from this semantic registration- Returns:
- a bounded prepared response or fixed error
- Since:
- 1.0.0
-
listResponseResult
Prepares a truthful index or cursor ListResponse from an application-produced page.- Parameters:
page- checked page and its originating query- Returns:
- a bounded prepared response or fixed error
- Since:
- 1.0.0
-
serviceProviderConfigResponseResult
Prepares bounded discovery with projection; discovery filters reject.- Parameters:
rawQuery- the original undecoded query without a leading question mark, or empty when absent- Returns:
- discovery or a fixed error
- Since:
- 1.0.0
-
resourceTypesResponseResult
Prepares bounded discovery with projection; discovery filters reject.- Parameters:
rawQuery- the original undecoded query without a leading question mark, or empty when absent- Returns:
- discovery or a fixed error
- Since:
- 1.0.0
-
resourceTypeResponseResult
public @NonNull ScimResponseResult resourceTypeResponseResult(@NonNull String resourceTypeName, @NonNull String rawQuery) Prepares bounded discovery with projection; discovery filters reject.- Parameters:
resourceTypeName- registered case-exact type namerawQuery- the original undecoded query without a leading question mark, or empty when absent- Returns:
- discovery or a fixed error
- Since:
- 1.0.0
-
schemasResponseResult
Prepares bounded discovery with projection; discovery filters reject.- Parameters:
rawQuery- the original undecoded query without a leading question mark, or empty when absent- Returns:
- discovery or a fixed error
- Since:
- 1.0.0
-
schemaResponseResult
public @NonNull ScimResponseResult schemaResponseResult(@NonNull String schemaId, @NonNull String rawQuery) Prepares bounded discovery with projection; discovery filters reject.- Parameters:
schemaId- registered schema identifierrawQuery- the original undecoded query without a leading question mark, or empty when absent- Returns:
- discovery or a fixed error
- Since:
- 1.0.0
-
noContentResponse
Returns the fixed bounded no-content response.- Returns:
- a bodyless 204 response
- Since:
- 1.0.0
-
notModifiedResponseResult
Prepares a bounded bodyless conditional read response with current ETag when enabled.- Parameters:
current- authoritative existing resource- Returns:
- a bounded 304 response or fixed error
- Since:
- 1.0.0
-
errorResponse
Returns a fixed bounded error without including request data or causes.- Parameters:
error- fixed core error- Returns:
- an error response
- Since:
- 1.0.0
-
toString
-