access

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ResourceInfraAPI = "infra"

Variables

This section is empty.

Functions

func Can added in v0.5.9

func Can(db *gorm.DB, identity uid.PolymorphicID, privilege, resource string) (bool, error)

Can checks if an identity has a privilege that means it can perform an action on a resource

func CreateAccessKey added in v0.5.4

func CreateAccessKey(c *gin.Context, accessKey *models.AccessKey, identityID uid.ID) (body string, err error)

func CreateCredential added in v0.6.0

func CreateCredential(c *gin.Context, user models.Identity) (string, error)

func CreateDestination

func CreateDestination(c *gin.Context, destination *models.Destination) error

func CreateGrant

func CreateGrant(c *gin.Context, grant *models.Grant) error

func CreateGroup

func CreateGroup(c *gin.Context, group *models.Group) error

func CreateIdentity added in v0.9.0

func CreateIdentity(c *gin.Context, identity *models.Identity) error

func CreateProvider

func CreateProvider(c *gin.Context, provider *models.Provider) error

func CreateToken added in v0.9.0

func CreateToken(c *gin.Context) (token *models.Token, err error)

func CurrentIdentity added in v0.9.0

func CurrentIdentity(c *gin.Context) *models.Identity

func CurrentIdentityProvider added in v0.6.1

func CurrentIdentityProvider(c *gin.Context) (*models.Provider, error)

CurrentIdentityProvider returns the provider for the current identity in the request context

func DeleteAccessKey added in v0.5.4

func DeleteAccessKey(c *gin.Context, id uid.ID) error

func DeleteAllIdentityAccessKeys added in v0.9.0

func DeleteAllIdentityAccessKeys(c *gin.Context) error

func DeleteDestination

func DeleteDestination(c *gin.Context, id uid.ID) error

func DeleteGrant

func DeleteGrant(c *gin.Context, id uid.ID) error

func DeleteIdentity added in v0.9.0

func DeleteIdentity(c *gin.Context, id uid.ID) error

func DeleteProvider

func DeleteProvider(c *gin.Context, id uid.ID) error

func DeleteRequestAccessKey added in v0.5.9

func DeleteRequestAccessKey(c *gin.Context) error

func ExchangeAccessKey added in v0.5.9

func ExchangeAccessKey(c *gin.Context, requestingAccessKey string, expiry time.Time) (string, *models.Identity, error)

ExchangeAccessKey allows a key exchange to get a new key with a shorter lifetime

func ExchangeAuthCodeForAccessKey added in v0.5.4

func ExchangeAuthCodeForAccessKey(c *gin.Context, code string, provider *models.Provider, oidc authn.OIDC, expires time.Time, redirectURL string) (*models.Identity, string, error)

func GetDestination

func GetDestination(c *gin.Context, id uid.ID) (*models.Destination, error)

func GetGrant

func GetGrant(c *gin.Context, id uid.ID) (*models.Grant, error)

func GetGroup

func GetGroup(c *gin.Context, id uid.ID) (*models.Group, error)

func GetIdentity added in v0.9.0

func GetIdentity(c *gin.Context, id uid.ID) (*models.Identity, error)

func GetProvider

func GetProvider(c *gin.Context, id uid.ID) (*models.Provider, error)

func ListAccessKeys added in v0.5.4

func ListAccessKeys(c *gin.Context, identityID uid.ID, name string) ([]models.AccessKey, error)

func ListDestinations

func ListDestinations(c *gin.Context, uniqueID, name string) ([]models.Destination, error)

func ListGrants

func ListGrants(c *gin.Context, subject uid.PolymorphicID, resource string, privilege string) ([]models.Grant, error)

func ListGroupGrants

func ListGroupGrants(c *gin.Context, groupID uid.ID) ([]models.Grant, error)

func ListGroups

func ListGroups(c *gin.Context, name string, providerID uid.ID) ([]models.Group, error)

func ListIdentities added in v0.9.0

func ListIdentities(c *gin.Context, email string, providerID uid.ID) ([]models.Identity, error)

func ListIdentityGrants added in v0.9.0

func ListIdentityGrants(c *gin.Context, identityID uid.ID) ([]models.Grant, error)

func ListIdentityGroups added in v0.9.0

func ListIdentityGroups(c *gin.Context, userID uid.ID) ([]models.Group, error)

func ListProviders

func ListProviders(c *gin.Context, name string) ([]models.Provider, error)

func LoginWithUserCredential added in v0.6.0

func LoginWithUserCredential(c *gin.Context, email, password string, expiry time.Time) (string, *models.Identity, bool, error)

func RequireInfraRole added in v0.8.0

func RequireInfraRole(c *gin.Context, oneOfRoles ...string) (*gorm.DB, error)

RequireInfraRole checks that the identity in the context can perform an action on a resource based on their granted roles

func RetrieveUserProviderTokens

func RetrieveUserProviderTokens(c *gin.Context) (*models.ProviderToken, error)

RetrieveUserProviderTokens gets the provider tokens that the current session token was created for

func SaveDestination

func SaveDestination(c *gin.Context, destination *models.Destination) error

func SaveProvider

func SaveProvider(c *gin.Context, provider *models.Provider) error

func Setup added in v0.5.9

func Setup(c *gin.Context) (string, *models.AccessKey, error)

func SetupRequired added in v0.5.9

func SetupRequired(c *gin.Context) (bool, error)

func UpdateCredential added in v0.6.0

func UpdateCredential(c *gin.Context, user *models.Identity, newPassword string) error

func UpdateProviderToken

func UpdateProviderToken(c *gin.Context, providerToken *models.ProviderToken) error

UpdateProviderToken overwrites an existing set of provider tokens

func UpdateUserInfo

func UpdateUserInfo(c *gin.Context, info *authn.UserInfo, user *models.Identity, provider *models.Provider) error

UpdateUserInfo calls the user info endpoint of an external identity provider to see a user's current attributes

Types

This section is empty.

Jump to

Keyboard shortcuts

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