graphql

package
v0.0.0-...-c4f7e29 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuditLogData = graphqlutil.NewJSONObjectScalar(
	"AuditLogData",
	"The `AuditLogData` scalar type represents the data of the audit log",
)
View Source
var AuthenticatorClaims = graphqlutil.NewJSONObjectScalar(
	"AuthenticatorClaims",
	"The `AuthenticatorClaims` scalar type represents a set of claims belonging to an authenticator",
)
View Source
var DependencySet = wire.NewSet(
	NewLogger,
	wire.Struct(new(Context), "*"),
)
View Source
var IdentityClaims = graphqlutil.NewJSONObjectScalar(
	"IdentityClaims",
	"The `IdentityClaims` scalar type represents a set of claims belonging to an identity",
)
View Source
var Schema *graphql.Schema
View Source
var UserCustomAttributes = graphqlutil.NewJSONObjectScalar(
	"UserCustomAttributes",
	"The `UserCustomAttributes` scalar type represents the custom attributes of the user",
)
View Source
var UserStandardAttributes = graphqlutil.NewJSONObjectScalar(
	"UserStandardAttributes",
	"The `UserStandardAttributes` scalar type represents the standard attributes of the user",
)
View Source
var Web3Claims = graphqlutil.NewJSONObjectScalar(
	"Web3Claims",
	"The `Web3Claims` scalar type represents the scalar type of the user",
)

Functions

func WithContext

func WithContext(ctx context.Context, gqlContext *Context) context.Context

Types

type AuditLogFacade

type AuditLogFacade interface {
	QueryPage(opts audit.QueryPageOptions, pageArgs graphqlutil.PageArgs) ([]apimodel.PageItemRef, *graphqlutil.PageResult, error)
}

type AuditLogLoader

type AuditLogLoader interface {
	graphqlutil.DataLoaderInterface
}

type AuthenticatorFacade

type AuthenticatorFacade interface {
	Get(id string) (*authenticator.Info, error)
	List(userID string, authenticatorType *apimodel.AuthenticatorType, authenticatorKind *authenticator.Kind) ([]*authenticator.Ref, error)
	Remove(authenticatorInfo *authenticator.Info) error
}

type AuthenticatorLoader

type AuthenticatorLoader interface {
	graphqlutil.DataLoaderInterface
}

type AuthorizationFacade

type AuthorizationFacade interface {
	Get(id string) (*oauth.Authorization, error)
	List(userID string, filters ...oauth.AuthorizationFilter) ([]*oauth.Authorization, error)
	Delete(a *oauth.Authorization) error
}

type Context

type Context struct {
	GQLLogger Logger

	Config                *config.AppConfig
	OAuthConfig           *config.OAuthConfig
	AdminAPIFeatureConfig *config.AdminAPIFeatureConfig

	Users          UserLoader
	Identities     IdentityLoader
	Authenticators AuthenticatorLoader
	Roles          RoleLoader
	Groups         GroupLoader
	AuditLogs      AuditLogLoader

	UserFacade          UserFacade
	RolesGroupsFacade   RolesGroupsFacade
	AuditLogFacade      AuditLogFacade
	IdentityFacade      IdentityFacade
	AuthenticatorFacade AuthenticatorFacade
	VerificationFacade  VerificationFacade
	SessionFacade       SessionFacade
	UserProfileFacade   UserProfileFacade
	AuthorizationFacade AuthorizationFacade
	OAuthFacade         OAuthFacade
	SessionListing      SessionListingService
	OTPCode             OTPCodeService
	ForgotPassword      ForgotPasswordService
	Events              EventService
}

func GQLContext

func GQLContext(ctx context.Context) *Context

func (*Context) Logger

func (c *Context) Logger() *log.Logger

type EntityRef

type EntityRef interface {
	GetMeta() model.Meta
}

type EventService

type EventService interface {
	DispatchEventOnCommit(payload event.Payload) error
}

type ForgotPasswordService

type ForgotPasswordService interface {
	SendCode(loginID string, options *forgotpassword.CodeOptions) error
}

type GroupLoader

type GroupLoader interface {
	graphqlutil.DataLoaderInterface
}

type IdentityFacade

type IdentityFacade interface {
	Get(id string) (*identity.Info, error)
	List(userID string, identityType *apimodel.IdentityType) ([]*apimodel.IdentityRef, error)
	Remove(identityInfo *identity.Info) error
	Create(userID string, identityDef model.IdentityDef, password string) (*apimodel.IdentityRef, error)
	Update(identityID string, userID string, identityDef model.IdentityDef) (*apimodel.IdentityRef, error)
}

type IdentityLoader

type IdentityLoader interface {
	graphqlutil.DataLoaderInterface
}

type Logger

type Logger struct{ *log.Logger }

func NewLogger

func NewLogger(lf *log.Factory) Logger

type OAuthFacade

type OAuthFacade interface {
	CreateSession(clientID string, userID string) (session.Session, protocol.TokenResponse, error)
}

type OTPCodeService

type OTPCodeService interface {
	GenerateOTP(kind otp.Kind, target string, form otp.Form, opts *otp.GenerateOptions) (string, error)
}

type OTPPurpose

type OTPPurpose string
const (
	OTPPurposeLogin        OTPPurpose = "login"
	OTPPurposeVerification OTPPurpose = "verification"
)

type Resolver

type Resolver func(ctx *Context, id string) (interface{}, error)

type RoleLoader

type RoleLoader interface {
	graphqlutil.DataLoaderInterface
}

type RolesGroupsFacade

type RolesGroupsFacade interface {
	CreateRole(options *rolesgroups.NewRoleOptions) (string, error)
	UpdateRole(options *rolesgroups.UpdateRoleOptions) error
	DeleteRole(id string) error
	ListGroupsByRoleID(roleID string) ([]*apimodel.Group, error)
	ListRoles(options *rolesgroups.ListRolesOptions, pageArgs graphqlutil.PageArgs) ([]apimodel.PageItemRef, *graphqlutil.PageResult, error)

	CreateGroup(options *rolesgroups.NewGroupOptions) (string, error)
	UpdateGroup(options *rolesgroups.UpdateGroupOptions) error
	DeleteGroup(id string) error
	ListRolesByGroupID(groupID string) ([]*apimodel.Role, error)
	ListGroups(options *rolesgroups.ListGroupsOptions, pageArgs graphqlutil.PageArgs) ([]apimodel.PageItemRef, *graphqlutil.PageResult, error)

	AddRoleToGroups(options *rolesgroups.AddRoleToGroupsOptions) (string, error)
	RemoveRoleFromGroups(options *rolesgroups.RemoveRoleFromGroupsOptions) (string, error)

	AddRoleToUsers(options *rolesgroups.AddRoleToUsersOptions) (string, error)
	RemoveRoleFromUsers(options *rolesgroups.RemoveRoleFromUsersOptions) (string, error)

	AddGroupToUsers(options *rolesgroups.AddGroupToUsersOptions) (groupID string, err error)
	RemoveGroupFromUsers(options *rolesgroups.RemoveGroupFromUsersOptions) (groupID string, err error)

	AddGroupToRoles(options *rolesgroups.AddGroupToRolesOptions) (groupID string, err error)
	RemoveGroupFromRoles(options *rolesgroups.RemoveGroupFromRolesOptions) (groupID string, err error)

	AddUserToRoles(options *rolesgroups.AddUserToRolesOptions) (err error)
	RemoveUserFromRoles(options *rolesgroups.RemoveUserFromRolesOptions) (err error)

	AddUserToGroups(options *rolesgroups.AddUserToGroupsOptions) (err error)
	RemoveUserFromGroups(options *rolesgroups.RemoveUserFromGroupsOptions) (err error)

	ListRolesByUserID(userID string) ([]*apimodel.Role, error)
	ListGroupsByUserID(userID string) ([]*apimodel.Group, error)
	ListUserIDsByRoleID(roleID string, pageArgs graphqlutil.PageArgs) ([]apimodel.PageItemRef, *graphqlutil.PageResult, error)
	ListUserIDsByGroupID(groupID string, pageArgs graphqlutil.PageArgs) ([]apimodel.PageItemRef, *graphqlutil.PageResult, error)
	ListEffectiveRolesByUserID(userID string) ([]*apimodel.Role, error)
	ListAllUserIDsByGroupIDs(groupIDs []string) ([]string, error)
	ListAllUserIDsByGroupKeys(groupKeys []string) ([]string, error)
	ListAllUserIDsByRoleIDs(roleIDs []string) ([]string, error)
	ListAllUserIDsByEffectiveRoleIDs(roleIDs []string) ([]string, error)
	ListAllRolesByKeys(keys []string) ([]*apimodel.Role, error)
	ListAllGroupsByKeys(keys []string) ([]*apimodel.Group, error)

	GetRole(roleID string) (*apimodel.Role, error)
	GetGroup(groupID string) (*apimodel.Group, error)
}

type SessionFacade

type SessionFacade interface {
	List(userID string) ([]session.Session, error)
	Get(id string) (session.Session, error)
	Revoke(id string) error
	RevokeAll(userID string) error
}

type SessionListingService

type SessionListingService interface {
	FilterForDisplay(sessions []session.Session, currentSession session.Session) ([]*sessionlisting.Session, error)
}

type UserFacade

type UserFacade interface {
	ListPage(listOption libuser.ListOptions, args graphqlutil.PageArgs) ([]apimodel.PageItemRef, *graphqlutil.PageResult, error)
	SearchPage(
		searchKeyword string,
		filterOptions libuser.FilterOptions,
		sortOption libuser.SortOption,
		args graphqlutil.PageArgs) ([]apimodel.PageItemRef, *graphqlutil.PageResult, error)
	Create(identityDef model.IdentityDef, password string) (string, error)
	ResetPassword(id string, password string) error
	SetDisabled(id string, isDisabled bool, reason *string) error
	ScheduleDeletion(id string) error
	UnscheduleDeletion(id string) error
	Delete(id string) error
	ScheduleAnonymization(id string) error
	UnscheduleAnonymization(id string) error
	Anonymize(id string) error
}

type UserLoader

type UserLoader interface {
	graphqlutil.DataLoaderInterface
}

type UserProfileFacade

type UserProfileFacade interface {
	DeriveStandardAttributes(role accesscontrol.Role, userID string, updatedAt time.Time, attrs map[string]interface{}) (map[string]interface{}, error)
	ReadCustomAttributesInStorageForm(role accesscontrol.Role, userID string, storageForm map[string]interface{}) (map[string]interface{}, error)
	UpdateUserProfile(
		role accesscontrol.Role,
		userID string,
		stdAttrs map[string]interface{},
		customAttrs map[string]interface{},
	) error
}

type VerificationFacade

type VerificationFacade interface {
	Get(userID string) ([]model.Claim, error)
	SetVerified(userID string, claimName string, claimValue string, isVerified bool) error
}

Jump to

Keyboard shortcuts

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