Documentation ¶
Index ¶
- func AgsGetGradesHandlerCreator(registrationDS registrationDatastore.RegistrationDatastore, ...) func(http.Handler) http.Handler
- func AgsPutGradeHandlerCreator(registrationDS registrationDatastore.RegistrationDatastore, ...) func(http.Handler) http.Handler
- func FromAnyParameter(param string) jwtmiddleware.TokenExtractor
- func GetClaims(req *http.Request) jwt.MapClaims
- func GetLaunchID(req *http.Request) string
- func MessageLaunchHandlerCreator(registrationDS registrationDatastore.RegistrationDatastore, ...) func(http.Handler) http.Handler
- func NrpsGetMemberHandlerCreator(registrationDS registrationDatastore.RegistrationDatastore, ...) func(http.Handler) http.Handler
- type AssignmentsGradeService
- type Grade
- type LineItem
- type MessageLaunch
- type NameRolesProvisioningService
- type NrpsContext
- type NrpsMember
- type NrpsMemberResponse
- type OidcLogin
- type Result
- type ServiceConnector
- type ServiceResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgsGetGradesHandlerCreator ¶
func AgsGetGradesHandlerCreator(registrationDS registrationDatastore.RegistrationDatastore, cache ltiCache.Cache, store sessions.Store, sessionName string, debug bool, pLineItem *LineItem) func(http.Handler) http.Handler
AgsGetGradesHandlerCreator returns a function which creates an http.Handler that uses a cached LTI Message launch's assessment grade service
to fetch the grades for a given lineitem from the service.
Expected method: Get, params: launchId
func AgsPutGradeHandlerCreator ¶
func AgsPutGradeHandlerCreator(registrationDS registrationDatastore.RegistrationDatastore, cache ltiCache.Cache, store sessions.Store, sessionName string, debug bool, pLineItem *LineItem) func(http.Handler) http.Handler
AgsPutGradeHandlerCreator returns a function which creates an http.Handler that uses a cached LTI Message launch's assessment grade service
to push a grade to the service.
Expected method: Get, params: score, userId, launchId
func FromAnyParameter ¶
func FromAnyParameter(param string) jwtmiddleware.TokenExtractor
FromAnyParameter returns a TokenExtractor that fetches the jwt from the body of the post or the query param
func GetClaims ¶
GetClaims fetches the user's jwt claims from the context. It fetches it from the JWT that the jwt middleware stored in the request context
func GetLaunchID ¶
GetLaunchID fetches the launchID associated with this request. It is stored in the request context if present.
func MessageLaunchHandlerCreator ¶
func MessageLaunchHandlerCreator(registrationDS registrationDatastore.RegistrationDatastore, cache ltiCache.Cache, store sessions.Store, sessionName string, debug bool) func(http.Handler) http.Handler
MessageLaunchHandlerCreator returns a function that creates http handler functions that handle the LTI 1.3 message launch. The function that the creator creates wraps a handler with middleware that grabs the JWT, validates it and checks that it is a valid LTI Message Launch request
func NrpsGetMemberHandlerCreator ¶
func NrpsGetMemberHandlerCreator(registrationDS registrationDatastore.RegistrationDatastore, cache ltiCache.Cache, store sessions.Store, sessionName string, debug bool) func(http.Handler) http.Handler
NrpsGetMemberHandlerCreator returns a function which creates an http.Handler that uses a cached LTI Message launch's name role provisioning service
to fetch a list of users from that context.
Types ¶
type AssignmentsGradeService ¶
type AssignmentsGradeService struct {
// contains filtered or unexported fields
}
AssignmentsGradeService offers the endpoints as specified in lti13
func NewAssignmentsGradeService ¶
func NewAssignmentsGradeService(conn *ServiceConnector, data *jwt.MapClaims) *AssignmentsGradeService
NewAssignmentsGradeService creates a new AGS with (JWT) data from the claim
func (*AssignmentsGradeService) GetGrades ¶
func (s *AssignmentsGradeService) GetGrades(pLineItem *LineItem) ([]Result, error)
GetGrades is an lti1.3 specified AGS call. It returns the results of grades for the given line item. If the line item is nil, then a default one is assumed and created, if necessary.
type Grade ¶
type Grade struct { ScoreGiven int `json:"scoreGiven"` ScoreMax int `json:"scoreMaximum"` ActivityProgress int `json:"activityProgress"` GradingProgress int `json:"gradingProgress"` Timestamp time.Time `json:"timestamp"` UserID string `json:"userId"` }
Grade contains attributes for a grade
type LineItem ¶
type LineItem struct { ID string `json:"id"` ScoreMax int `json:"scoreMaximum"` Label string `json:"label"` ResourceID string `json:"resourceid"` Tag string `json:"tag"` StartDateTime time.Time `json:"startDateTime"` EndDateTime time.Time `json:"endDateTime"` }
LineItem represents a resource's item which can be assigned and graded
type MessageLaunch ¶
type MessageLaunch struct { Debug bool // contains filtered or unexported fields }
MessageLaunch a struct that represents an LTI 1.3 Tool Launch
func NewMessageLaunch ¶
func NewMessageLaunch(registrationDS registrationDatastore.RegistrationDatastore, cache ltiCache.Cache, store sessions.Store, sessionName string, debug bool) *MessageLaunch
NewMessageLaunch creates a MessageLaunch with params.
func NewMessageLaunchFromCache ¶
func NewMessageLaunchFromCache(launchID string, r *http.Request, registrationDS registrationDatastore.RegistrationDatastore, cache ltiCache.Cache, store sessions.Store, sessionName string, debug bool) (*MessageLaunch, error)
NewMessageLaunchFromCache creates a MessageLaunch with params that is associated with a cached launch id (cached jwt payload)
func (*MessageLaunch) GetAgs ¶
func (M *MessageLaunch) GetAgs() (*AssignmentsGradeService, error)
GetAgs returns the name roles provisioning service associated with this message launch context
func (*MessageLaunch) GetNrps ¶
func (M *MessageLaunch) GetNrps() (*NameRolesProvisioningService, error)
GetNrps returns the name roles provisioning service associated with this message launch context
type NameRolesProvisioningService ¶
type NameRolesProvisioningService struct {
// contains filtered or unexported fields
}
NameRolesProvisioningService offers the endpoints as specified in lti13
func NewNameRolesProvisioningService ¶
func NewNameRolesProvisioningService(conn *ServiceConnector, data *jwt.MapClaims) *NameRolesProvisioningService
NewNameRolesProvisioningService creates a new NameRolesProvisioningService
func (*NameRolesProvisioningService) GetMembers ¶
func (s *NameRolesProvisioningService) GetMembers() (*NrpsMemberResponse, error)
GetMembers uses the Message Launches context and auth token to return a list of users associated with this launch
type NrpsContext ¶
type NrpsContext struct { ID int `json:"id"` Label string `json:"label"` Title string `json:"title"` }
NrpsContext contains context info for getMembers call
type NrpsMember ¶
type NrpsMember struct { Name string `json:"name"` Picture string `json:"picture"` GivenName string `json:"given_name"` FamilyName string `json:"family_name"` MiddleName string `json:"middle_name"` Email string `json:"email"` UserID string `json:"user_id"` LisPersonSourcedid string `json:"lis_person_sourcedid"` Roles []string `json:"roles"` }
NrpsMember contains attributes for a single member
type NrpsMemberResponse ¶
type NrpsMemberResponse struct { ID string `json:"id"` Context NrpsContext `json:"context"` Members []NrpsMember `json:"members"` }
NrpsMemberResponse hold the response from a getMember call
type OidcLogin ¶
type OidcLogin struct {
// contains filtered or unexported fields
}
OidcLogin class that is setup to handle LTI 1.3 logins
func NewOidcLogin ¶
func NewOidcLogin(registrationDS registrationDatastore.RegistrationDatastore, cache ltiCache.Cache, store sessions.Store, launchURL, sessionName string) *OidcLogin
NewOidcLogin creates a new OidcLogin with given args
func (*OidcLogin) LoginRedirectHandler ¶
LoginRedirectHandler creates http handler that processes login requests from an LTI 1.3 tool provider / platform example params (post or get) utf8=%E2%9C%93&iss=http%3A%2F%2Fimsglobal.org&login_hint=29922&target_link_uri=http%3A%2F%2Flocalhost%3A9001%2Fexample%2Flaunch.php<i_message_hint=701&commit=Post+request The response is a redirect back to the tool platform that will launch the tool (via lti.MessageLaunch)
type Result ¶
type Result struct { UserID string `json:"userId"` ResultScore string `json:"resultScore"` ResultMaximum int `json:"resultMaximum"` Comment string `json:"comment"` ID string `json:"id"` ScoreOf string `json:"scoreOf"` }
Result contains attributes about a particular users grade
type ServiceConnector ¶
type ServiceConnector struct {
// contains filtered or unexported fields
}
ServiceConnector helper util that can hit endpoints associated with an lti1.3 launch
func NewServiceConnector ¶
func NewServiceConnector(reg registrationDatastore.Registration) *ServiceConnector
NewServiceConnector creates a new ServiceConnector
func (*ServiceConnector) DoServiceRequest ¶
func (s *ServiceConnector) DoServiceRequest(scopes []string, url, pMethod, body, pContentType, pAccept string) (*ServiceResult, error)
DoServiceRequest fetches an auth token for a service call, then makes and returns the results of that call
type ServiceResult ¶
ServiceResult is a holder object for the results of a service call