Documentation ¶
Overview ¶
Package lti supports the development of LTI 1.3 tools. It provides types and methods to support the OpenID Connect flow, the tool launch, and the use of a platform's 'Names and Role Provisioning Services' and 'Assignment and Grade Services.'
Index ¶
- func GetLaunchContextKey() launch.ContextKeyType
- func LaunchIDFromContext(ctx context.Context) string
- func LaunchIDFromRequest(r *http.Request) string
- func NewConnector(cfg datastore.Config, launchID, keyID string) (*connector.Connector, error)
- func NewDatastoreConfig() datastore.Config
- func NewLaunch(cfg datastore.Config, next http.HandlerFunc) *launch.Launch
- func NewLogin(cfg datastore.Config) *login.Login
- func NewSQLDatastore(db *sql.DB, config dssql.Config) *dssql.Store
- func NewSQLDatastoreConfig() dssql.Config
- type JSONWebKeySet
- type KeySet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLaunchContextKey ¶
func GetLaunchContextKey() launch.ContextKeyType
GetLaunchContextKey returns the context key used for attaching the launch ID to the request context.
func LaunchIDFromContext ¶
LaunchIDFromContext takes the context of an *http.Request (after a successful launch), and it returns the launch ID that was attached to that context.
func LaunchIDFromRequest ¶
LaunchIDFromRequest takes an *http.Request (after a successful launch), and it returns the launch ID that was attached to that request.
func NewConnector ¶
NewConnector returns a *connector.Connector (on success) that can be used for accessing LTI services. These services include Names and Role Provisioning Services (NRPS) and Assignment and Grade Services (AGS). The returned connector needs to be successfully `upgraded' (which returns a new type) before it can be used for these services.
func NewDatastoreConfig ¶
NewDatastoreConfig returns a new datastore configuration. Unless specified otherwise, all of the data stores will be internal/nonpersistent.
func NewLaunch ¶
NewLaunch returns a pointer to a new Launch object. This object is an http.Handler so it can be easily associated with a tool URI, e.g., /services/lti/launch/. Its second argument, `next', is the HTTP handler to run on a successful launch.
After a successful launch, further LTI requests must include the launch ID in their requests. To support a variety of tool implementation, the launch ID is attached to the *http.Request context immediately prior to calling `next'. Convenience functions, like `LaunchIDFromRequest' and `LaunchIDFromContext', also available in this package, simplify the retrieval of this launch ID.
func NewLogin ¶
NewLogin returns a pointer to a new Login object. This object is an http.Handler so it can easily be associated with tool URI, e.g., /services/lti/login/. It also provides other methods related to the redirect back to the platform.
func NewSQLDatastore ¶
NewSQLDatastore returns a new SQL datastore using the provided configuration. The configuration provides the table and field names used in queries on that database.
func NewSQLDatastoreConfig ¶
NewSQLDatastoreConfig returns a new SQL datastore configuration containing the library's default table and field names. These table and field names can be modified before calling NewSQLDatastore.
Types ¶
type JSONWebKeySet ¶
JSONWebKeySet provides configuration for a keyset handler implemented on this type. The ServeHTTP method is implemented for this type to allow it to serve as an http.Handler.
func NewKeySet ¶
func NewKeySet(identifier, privateKey string) *JSONWebKeySet
NewKeySet returns a *JSONWebKeySet that provides the key used to verify the sender authenticity of JSON Web Tokens exchanged as part of accessing LTI services between Platforms and Tools. This object is an http.handler so it can be easily associated with a keyset URI, e.g., /services/lti/keyset.
func (*JSONWebKeySet) ServeHTTP ¶
func (j *JSONWebKeySet) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP makes the JSONWebKeySet type a handler to provide a JSON Web Key Set response for key fetch requests.
Directories ¶
Path | Synopsis |
---|---|
Package connector provides LTI Advantage services built upon a successful Launch.
|
Package connector provides LTI Advantage services built upon a successful Launch. |
Package datastore implements the interfaces and types for all the different storers used in LTI.
|
Package datastore implements the interfaces and types for all the different storers used in LTI. |
nonpersistent
Package nonpersistent implements an in-memory (non-persistent) data store.
|
Package nonpersistent implements an in-memory (non-persistent) data store. |
sql
Package sql implements a persistent SQL data store.
|
Package sql implements a persistent SQL data store. |
Package launch provides functions and methods for LTI's tool launch.
|
Package launch provides functions and methods for LTI's tool launch. |
Package login provides functions and methods for LTI's modified OpenID Connect login flow.
|
Package login provides functions and methods for LTI's modified OpenID Connect login flow. |