Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(usersClient usersgrpc.UserServiceClient, devicesClient services.UserDeviceAPIService, 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.
Click to show internal directories.
Click to hide internal directories.