Opened 10 years ago

Closed 10 years ago

#1799 closed enhancement (fixed)

Service extensions should have a way to access the database

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.3
Component: web Version:
Keywords: Cc:

Description

The current implementation of the "services" extension point allows code to be executed when the BASE server starts up, but the code has very limited access to do things because at this time no user is logged in.

Until now this has not been an issue since the only extension so far has been the "FTP server" (http://baseplugins.thep.lu.se/wiki/net.sf.basedb.ftp) which is just waiting for a user to log in via FTP.

Upcoming use cases has changed the situation. Reggie (http://baseplugins.thep.lu.se/wiki/net.sf.basedb.reggie) has need to monitor external jobs (on a Open Grid Scheduler cluster) and report back progress to BASE.

The LabEnv extension (http://baseplugins.thep.lu.se/wiki/net.sf.basedb.labenv) may want some kind of notification function to send messages via BASE if temperature/humidity is outside a specified range.

Both use cases require that the service extension can access and create items in BASE without a user is logged in. One solution is to configure a username/password for the extension but this feels a bit complicated.

Another solution is something that is similar to how the internal job queue is working. The internal job queue has access to a special SessionControl item with a single permission: impersonate another user. This makes it possible to login as any user without having access to the password.

Change History (3)

comment:1 by Nicklas Nordborg, 10 years ago

(In [6440]) References #1799: Service extensions should have a way to access the database

Service extensions now get access to a SessionControl object with permission to impersonate users.

comment:2 by Nicklas Nordborg, 10 years ago

(In [6443]) References #1799: Service extensions should have a way to access the database

Updated documentation.

comment:3 by Nicklas Nordborg, 10 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.