scope

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 19 Imported by: 6 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLightweightAccountScope

func AddLightweightAccountScope(role authpb.Role, scopes map[string]*authpb.Scope) (map[string]*authpb.Scope, error)

AddLightweightAccountScope adds the scope to allow access to lightweight user.

func AddOCMShareScope added in v0.0.29

func AddOCMShareScope(share *ocmv1beta1.Share, role authpb.Role, scopes map[string]*authpb.Scope) (map[string]*authpb.Scope, error)

AddOCMShareScope adds the scope to allow access to an OCM share and the share resource.

func AddOwnerScope

func AddOwnerScope(scopes map[string]*authpb.Scope) (map[string]*authpb.Scope, error)

AddOwnerScope adds the default owner scope with access to all resources.

func AddPublicShareScope

func AddPublicShareScope(share *link.PublicShare, role authpb.Role, scopes map[string]*authpb.Scope) (map[string]*authpb.Scope, error)

AddPublicShareScope adds the scope to allow access to a public share and the shared resource.

func AddReceivedShareScope

func AddReceivedShareScope(share *collaboration.ReceivedShare, role authpb.Role, scopes map[string]*authpb.Scope) (map[string]*authpb.Scope, error)

AddReceivedShareScope adds the scope to allow access to a received user/group share and the shared resource.

func AddResourceInfoScope

func AddResourceInfoScope(r *provider.ResourceInfo, role authpb.Role, scopes map[string]*authpb.Scope) (map[string]*authpb.Scope, error)

AddResourceInfoScope adds the scope to allow access to a resource info object.

func AddShareScope

func AddShareScope(share *collaboration.Share, role authpb.Role, scopes map[string]*authpb.Scope) (map[string]*authpb.Scope, error)

AddShareScope adds the scope to allow access to a user/group share and the shared resource.

func FormatScope

func FormatScope(scopeType string, scope *authpb.Scope) (string, error)

FormatScope create a pretty print of the scope.

func GetOCMSharesFromScopes added in v0.0.29

func GetOCMSharesFromScopes(scopes map[string]*authpb.Scope) ([]*ocmv1beta1.Share, error)

GetOCMSharesFromScopes returns all OCM shares in the given scope.

func GetPublicSharesFromScopes added in v0.0.24

func GetPublicSharesFromScopes(scopes map[string]*authpb.Scope) ([]*link.PublicShare, error)

GetPublicSharesFromScopes returns all public shares in the given scope.

func VerifyScope

func VerifyScope(ctx context.Context, scopeMap map[string]*authpb.Scope, resource interface{}) (bool, error)

VerifyScope is the function to be called when dismantling tokens to check if the token has access to a particular resource.

Types

type Verifier

type Verifier func(context.Context, *authpb.Scope, interface{}, *zerolog.Logger) (bool, error)

Verifier is the function signature which every scope verifier should implement.

Jump to

Keyboard shortcuts

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