authprocessor

package
v0.0.0-...-cced42b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package authprocessor checks if there's an authorization header, and then processes it into a path prefix and injects it into the context. It will construct an auth header like "foo;bar;baz" to "foo/bar/baz", which is used as a prefix to check for the files, relative to the serve root of the service. We are aware this is not an actual auth method. To repeat DO NOT USE THIS AS-IS IN PRODUCTION, THIS IS JUST TO DEMONSTRATE THAT THE AUTH HEADER IS BEING FORWARDED BY RUN-DSP. THIS OFFERS NO SECURITY.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPrefix

func ExtractPrefix(ctx context.Context) string

ExtractPrefix will extract the prefix from the context.

func StreamInterceptor

func StreamInterceptor(
	srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler,
) error

StreamInterceptor will process the authorization header, convert it to a prefix, and then inject it into the context, but for streams.

func UnaryInterceptor

func UnaryInterceptor(
	ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler,
) (any, error)

UnaryInterceptor will process the authorization header, convert it to a prefix, and then inject it into the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL