permissions

package
v0.4.25 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FunctionChecker

type FunctionChecker interface {
	FunctionExists(name string) bool
}

FunctionChecker allows the permissions service to verify that a function exists without importing the function_crud package directly.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service manages in-memory resource-based policies for Lambda functions and layers.

func New

func New(region, account string, checker FunctionChecker) *Service

func (*Service) AddLayerVersionPermission

func (s *Service) AddLayerVersionPermission(w http.ResponseWriter, r *http.Request, layerName string, versionNumber int)

POST /2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy

func (*Service) AddPermission

func (s *Service) AddPermission(w http.ResponseWriter, r *http.Request, functionName string)

POST /2015-03-31/functions/{FunctionName}/policy

func (*Service) GetLayerVersionPolicy

func (s *Service) GetLayerVersionPolicy(w http.ResponseWriter, r *http.Request, layerName string, versionNumber int)

GET /2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy

func (*Service) GetPolicy

func (s *Service) GetPolicy(w http.ResponseWriter, r *http.Request, functionName string)

GET /2015-03-31/functions/{FunctionName}/policy

func (*Service) RemoveLayerVersionPermission

func (s *Service) RemoveLayerVersionPermission(w http.ResponseWriter, r *http.Request, layerName string, versionNumber int, statementId string)

DELETE /2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}

func (*Service) RemovePermission

func (s *Service) RemovePermission(w http.ResponseWriter, r *http.Request, functionName, statementId string)

DELETE /2015-03-31/functions/{FunctionName}/policy/{StatementId}

type Statement

type Statement struct {
	Sid       string                       `json:"Sid"`
	Effect    string                       `json:"Effect"`
	Principal any                          `json:"Principal"` // string or {"Service": "..."} etc.
	Action    string                       `json:"Action"`
	Resource  string                       `json:"Resource,omitempty"`
	Condition map[string]map[string]string `json:"Condition,omitempty"`
}

Statement represents a single entry in a Lambda resource-based policy.

Jump to

Keyboard shortcuts

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