Skip to content

Instantly share code, notes, and snippets.

View satish860's full-sized avatar
🎯
Focusing

satish satish860

🎯
Focusing
View GitHub Profile
builder.Services.AddIdentityServer(options =>
{
// https://docs.duendesoftware.com/identityserver/v6/fundamentals/resources/api_scopes#authorization-based-on-scopes
options.EmitStaticAudienceClaim = true;
})
.AddInMemoryIdentityResources(Config.IdentityResources)
.AddInMemoryApiScopes(Config.ApiScopes)
.AddInMemoryClients(Config.Clients)
.AddTestUsers(TestUsers.Users); // Just add the user here
// Copyright (c) Duende Software. All rights reserved.
// See LICENSE in the project root for license information.
using IdentityModel;
using System.Security.Claims;
using System.Text.Json;
using Duende.IdentityServer;
using Duende.IdentityServer.Test;
@satish860
satish860 / docker-compose.yml
Created November 5, 2022 12:27
Docker compose for Redpanda
version: '3.7'
services:
redpanda:
image: docker.redpanda.com/vectorized/redpanda:v21.11.15
container_name: redpanda-1
command:
- redpanda
- start
- --smp
- '1'
public static IEnumerable<Client> Clients =>
new Client[]
{
new Client
{
ClientId = "storageclient",
ClientName = "storageclient",
AllowedGrantTypes = GrantTypes.Code,
AllowedScopes =
{
@satish860
satish860 / id.csv
Last active November 3, 2022 05:12
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 3 columns, instead of 2. in line 1.
Server discovery,Discover the OAuth 2.0 / OpenID Connect endpoints, capabilities supported cryptographic algorithms and features.
Federation entity statement, Obtain the authorities metadata and signing keys for a Connect2id server participating in a OpenID Connect federation.
Server JWK set,Retrieve the public server JSON Web Key (JWK) to verify the signature of an issued token or to encrypt request objects to it.
Client registration, Create, access, update or delete a client registration.
Federation client registration, Create an explicit client registration with a Connect2id server participating in a OpenID Connect federation.
Pushed authorisation requests, Submit the request parameters directly to the server before sending the end-user to the authorisation endpoint for login and consent.
Authorisation, The client sends the end-user's browser here to request the user's authentication and consent. This endpoint is used in the code and implicit OAuth 2.0 flows which require end-user interaction.
Token, Post
using Microsoft.AspNetCore.Http;
using System.Diagnostics;
using System.Net;
using Yarp.ReverseProxy.Forwarder;
using Yarp.ReverseProxy.Transforms;
using Yarp.ReverseProxy.Transforms.Builder;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpForwarder();
"ReverseProxy": {
"Routes": {
"route1": {
"ClusterId": "cluster1",
"Match": {
"Path": "/api/google"
},
"Transforms": [
{ "PathRemovePrefix": "/api/google" }
]
@satish860
satish860 / Yarp.cs
Created October 18, 2022 05:54
YARP initial configuration
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddReverseProxy()
.LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"));
var app = builder.Build();
app.MapReverseProxy();
app.Run();
/**
* Welcome to Cloudflare Workers! This is your first worker.
*
* - Run `wrangler dev src/index.ts` in your terminal to start a development server
* - Open a browser tab at http://localhost:8787/ to see your worker in action
* - Run `wrangler publish src/index.ts --name my-worker` to publish your worker
*
* Learn more at https://developers.cloudflare.com/workers/
*/
field description field
title Title of the book string
author Author string
edition Version of book int32
synopsis synopsis string
amazon_rating book rating float
release_date release date of book. It will be in unix timestamp format int64
tags Tags for book string*