owner

package
v0.7.37 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserID

func GetUserID(c *fiber.Ctx) string

func New

func New(usersClient pb.UserServiceClient, devicesClient services.UserDeviceService, logger *zerolog.Logger) fiber.Handler

New creates a new middleware handler that checks whether a user is authorized to access a user device. For the middleware to allow the request to proceed:

  • The request must have a valid JWT, identifying a user.
  • There must be a userDeviceID or ethAddr path parameter, and that device must exist.
  • Either the user owns the device, or the user's account has an Ethereum address that owns the corresponding NFT.

Types

This section is empty.

Jump to

Keyboard shortcuts

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