Skip to content

Instantly share code, notes, and snippets.

View trnktms's full-sized avatar
:octocat:

Tamás Tárnok trnktms

:octocat:
View GitHub Profile
namespace Feature.DI
{
public class RegisterContainer : IServicesConfigurator
{
public void Configure(IServiceCollection serviceCollection)
{
serviceCollection.AddTransient<ItemAuthorizationHelper, CustomItemAuthorizationHelper>();
}
}
}
namespace Feature.Providers.ItemAccessibility
{
public class CustomAuthorizationProvider : BucketAuthorizationProvider
{
[Obsolete]
public CustomAuthorizationProvider() : base()
{
ItemHelper = (ItemAuthorizationHelper)ServiceLocator.ServiceProvider.GetService(typeof(ItemAuthorizationHelper));
}
#!/bin/sh
pwsh.exe -ExecutionPolicy RemoteSigned -File '.githooks\pre-commit.ps1'
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;
{
"Host": "localhost:3000"
}
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/Welcome1",
"definitions": {
"Welcome1": {
"type": "object",
"additionalProperties": false,
"properties": {
"SomeObject": {
"$ref": "#/definitions/SomeObject"
$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
└─ 📂 tests
└─ 📂 api-tests
└─ 📂 <area>
├─ 📂 <api1>
│ ├─ 📄 response-schema.json
│ └─ 📄 test.ps1
├─ 📂 <api2>
│ ├─ 📄 response-schema.json
│ └─ 📄 test.ps1
├─ 📂 <api3>
import type { NextRequest } from 'next/server'
export const config = {
matcher: [
/* force middleware on root */
'/',
/* bypass middleware for Sitecore Experience Editor */
'/((?!api/editing/.?).*)',
],
};
$postParams = @{data='qwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwerty