github.com/wrgl/wrgl@v0.14.0/pkg/auth/authz.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright © 2022 Wrangle Ltd
     3  
     4  package auth
     5  
     6  import "net/http"
     7  
     8  const (
     9  	ScopeRepoRead  = "repo.read"
    10  	ScopeRepoWrite = "repo.write"
    11  )
    12  
    13  type AuthzStore interface {
    14  	AddPolicy(email, scope string) error
    15  	RemovePolicy(email, scope string) error
    16  	Authorized(r *http.Request, email, scope string) (bool, error)
    17  	ListPolicies(email string) (scopes []string, err error)
    18  	Flush() error
    19  }