View ClearAccessResultCache.cs
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
namespace Feature.EventHandlers | |
{ | |
public class ClearAccessResultCache | |
{ | |
private static readonly Dictionary<ID, ID> TemplatesToCheck = new Dictionary<ID, ID>() | |
{ | |
{ Constants.Template1.TemplateId, Constants.Template1.Fields.Role }, | |
{ Constants.Template2.TemplateId, Constants.Template2.Fields.Role } | |
}; |
View RegisterContainer.cs
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
namespace Feature.DI | |
{ | |
public class RegisterContainer : IServicesConfigurator | |
{ | |
public void Configure(IServiceCollection serviceCollection) | |
{ | |
serviceCollection.AddTransient<ItemAuthorizationHelper, CustomItemAuthorizationHelper>(); | |
} | |
} | |
} |
View pre-commit
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
#!/bin/sh | |
pwsh.exe -ExecutionPolicy RemoteSigned -File '.githooks\pre-commit.ps1' |
View pre-commit.ps1
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
try { | |
Get-ChildItem .\tests\api-tests\**.ps1 -Recurse | ForEach-Object { | |
Set-Location -Path $_.Directory | |
Write-Host "Running test: " .\ $_.Directory.Name \ $_.Name " -> " -NoNewline -Separator '' | |
(& $_.FullName) ? "Passed" : "Failed" | |
} | |
} | |
catch { | |
Write-Host "Failed" | |
throw; |
View config.json
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
{ | |
"Host": "localhost:3000" | |
} |
View response-schema.json
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
{ | |
"$schema": "http://json-schema.org/draft-06/schema#", | |
"$ref": "#/definitions/Welcome1", | |
"definitions": { | |
"Welcome1": { | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"SomeObject": { | |
"$ref": "#/definitions/SomeObject" |
View test.ps1
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
$config = Get-Content ../config.json | ConvertFrom-Json | |
$apiRoute = $config.SitecoreHost + '/api/<area>/<api1>' | |
$result = Invoke-WebRequest $apiRoute | |
Test-Json -Json $result -SchemaFile .\response-schema.json |
NewerOlder