access

package
v0.0.0-...-b66c160 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package access contains function to validate token and parse access from a valid token

for write operations (i.e., create and update).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAccess

func CheckAccess(token string, orgName string) error

This function takes input of a string of token and a string of organization's name. It checks whether the given token in valid and whether it contains access for write operation to *orgName*. If not, an error is returned.

func GetAccessField

func GetAccessField() (string, error)

func ParseAccess

func ParseAccess(token string) ([]string, error)

ParseAccess takes input of a token string. It first validates whether the token is valid using firebase, then parses from the token's claims a list organization names to which that the token owner has write access. If token is invalid, an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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