-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into resolver-priority
- Loading branch information
Showing
17 changed files
with
510 additions
and
137 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
32 changes: 16 additions & 16 deletions
32
ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/resources/ResourceWiring.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
package ch.epfl.bluebrain.nexus.ship.resources | ||
|
||
import cats.effect.{Clock, IO} | ||
import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.JsonLdApi | ||
import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.RemoteContextResolution | ||
import ch.epfl.bluebrain.nexus.delta.sdk.acls.AclCheck | ||
import ch.epfl.bluebrain.nexus.delta.sdk.projects.FetchContext | ||
import ch.epfl.bluebrain.nexus.delta.sdk.resolvers.ResourceResolution | ||
import ch.epfl.bluebrain.nexus.delta.sdk.resources.Resources.ResourceLog | ||
import ch.epfl.bluebrain.nexus.delta.sdk.resources.{DetectChange, Resources, ValidateResource} | ||
import ch.epfl.bluebrain.nexus.delta.sdk.resources.{DetectChange, FetchResource, Resources, ValidateResource} | ||
import ch.epfl.bluebrain.nexus.delta.sdk.schemas.FetchSchema | ||
import ch.epfl.bluebrain.nexus.delta.sdk.schemas.Schemas.SchemaLog | ||
import ch.epfl.bluebrain.nexus.delta.sourcing.config.EventLogConfig | ||
import ch.epfl.bluebrain.nexus.delta.sourcing.{ScopedEventLog, Transactors} | ||
import ch.epfl.bluebrain.nexus.ship.EventClock | ||
import ch.epfl.bluebrain.nexus.ship.acls.AclWiring | ||
import ch.epfl.bluebrain.nexus.ship.resolvers.ResolverWiring | ||
|
||
object ResourceWiring { | ||
|
||
def resourceLog( | ||
def apply( | ||
fetchContext: FetchContext, | ||
schemaLog: Clock[IO] => IO[SchemaLog], | ||
fetchSchema: FetchSchema, | ||
config: EventLogConfig, | ||
clock: EventClock, | ||
xas: Transactors | ||
)(implicit | ||
jsonLdApi: JsonLdApi | ||
): Clock[IO] => IO[ResourceLog] = { clock => | ||
val detectChange = DetectChange(false) | ||
val aclCheck = AclCheck(AclWiring.acls(config, clock, xas)) | ||
val resolvers = ResolverWiring.resolvers(fetchContext, config, clock, xas) | ||
): (ResourceLog, FetchResource) = { | ||
val rcr = RemoteContextResolution.never // TODO: Use correct RemoteContextResolution | ||
val detectChange = DetectChange(false) | ||
val aclCheck = AclCheck(AclWiring.acls(config, clock, xas)) | ||
val resolvers = ResolverWiring.resolvers(fetchContext, config, clock, xas) | ||
val resourceResolution = | ||
ResourceResolution.schemaResource(aclCheck, resolvers, fetchSchema, excludeDeprecated = false) | ||
val validate = ValidateResource(resourceResolution)(rcr) | ||
val resourceDef = Resources.definition(validate, detectChange, clock) | ||
|
||
for { | ||
fetchSchema <- schemaLog(clock).map(FetchSchema(_)) | ||
resourceResolution = | ||
ResourceResolution.schemaResource(aclCheck, resolvers, fetchSchema, excludeDeprecated = false) | ||
validate = ValidateResource(resourceResolution)(RemoteContextResolution.never) | ||
resourceDef = Resources.definition(validate, detectChange, clock) | ||
} yield ScopedEventLog(resourceDef, config, xas) | ||
val log = ScopedEventLog(resourceDef, config, xas) | ||
(log, FetchResource(log)) | ||
} | ||
|
||
} |
Oops, something went wrong.