-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/prerelease' into improvement/LIM…
…S-276/speed-up-get-all-containers-count Use the sub sample sub select query from LIMS-452
- Loading branch information
Showing
139 changed files
with
15,491 additions
and
9,879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,20 +13,32 @@ | |
$isb = array('user' => 'user', 'pass' => 'pass', 'db' => 'localhost/ispyb'); | ||
$dbtype = 'mysql'; | ||
|
||
# Summary Database credentials | ||
######### DELETE if not using connection. | ||
$summarydbconfig = array('user' => 'user', 'pass' => 'pass', 'db' => 'localhost/ispyb'); | ||
$ifsummary = true; | ||
|
||
# Encoded JWT key, used to sign and check validaty of jwt tokens | ||
# - Create one of these using /api/authenticate/key | ||
# This can be changed to invalidate all currently active tokens | ||
$jwt_key = ''; | ||
|
||
# Auth type | ||
# Can be cas, ldap | ||
# Can be cas, ldap, oidc | ||
$authentication_type = 'cas'; | ||
|
||
# CAS url (if using cas, assume https) | ||
$cas_url = 'cas.server.ac.uk'; | ||
|
||
# Follow CAS SSO | ||
$cas_sso = true; | ||
$sso_url = "sso.server.ac.uk"; | ||
|
||
# OIDC (or OAuth2) client ID and secret. Only useful if authentication_type is set to OIDC | ||
$oidc_client_id = "oidcClientId"; | ||
$oidc_client_secret = "oidcClientSecret"; | ||
# Cookie key used for SSO/cookie based authentication | ||
$cookie_key = "synchweb-auth"; | ||
|
||
# CAS CA Cert (for SSO) | ||
$cacert = '/etc/certs/ca-bundle.crt'; | ||
|
@@ -52,6 +64,9 @@ | |
# Timezone | ||
$timezone = 'Europe/London'; | ||
|
||
# URL to access the PV archiver | ||
$archive_url = ''; | ||
|
||
# Valid Components | ||
# Denotes that only staff may create proteins, otherwise they must come from replication | ||
# with a valid `externalid`, users may still clone proteins | ||
|
@@ -144,6 +159,13 @@ | |
# and for shipment booked, | ||
$shipbooked_email = '[email protected]'; | ||
|
||
# dewar back in storage (complete) | ||
$dewar_complete_email = ''; | ||
|
||
# Send a 'visit finished' email when a dewar moves from this beamline to this (regex) location | ||
$dewar_complete_email_locations = array('i03' => '/tray-\w+/', | ||
); | ||
|
||
# Industrial Contacts | ||
# - Industrial users get a personalised email with in contact details, | ||
# template in assets/emails/dewar-stores-in-in.html | ||
|
@@ -225,6 +247,7 @@ | |
|
||
# Shipping service details | ||
$use_shipping_service = null; | ||
$use_shipping_service_incoming_shipments = null; | ||
$shipping_service_url = null; | ||
$shipping_service_links_in_emails = null; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace SynchWeb\Authentication; | ||
|
||
class AuthenticationTypeFactory { | ||
|
||
// Array of authentication types and corresponding authentication class names. | ||
// Value is class name in SynchWeb\Authentication\Type namespace. | ||
// Key is lower case representation of class name. | ||
private $authentication_types = array( | ||
'cas' => 'CAS', | ||
'dummy' => 'Dummy', | ||
'ldap' => 'LDAP', | ||
'simple' => 'Simple', | ||
'oidc' => 'OIDC', | ||
'combined' => 'Combined', | ||
); | ||
|
||
// Return instance of authentication class corresponding to $authentication_type. | ||
// The value passed by the calling method derives from $authentication_type, a global variable specified in config.php. | ||
public function create($authentication_type) | ||
{ | ||
if (!$authentication_type) | ||
{ | ||
error_log("Authentication method not specified in config.php."); | ||
|
||
$authentication_type = 'cas'; | ||
} | ||
|
||
// Determine fully-qualified class name of authentication class corresponding to $authentication_type. | ||
$full_class_name = null; | ||
|
||
if (key_exists(strtolower($authentication_type), $this->authentication_types)) | ||
{ | ||
$full_class_name = 'SynchWeb\\Authentication\\Type\\' . $this->authentication_types[$authentication_type]; | ||
} | ||
else | ||
{ | ||
throw new \Exception("Authentication method '$authentication_type' not configured."); | ||
} | ||
|
||
// Return instance of authentication class. | ||
if (class_exists($full_class_name)) | ||
{ | ||
return new $full_class_name(); | ||
} | ||
else | ||
{ | ||
throw new \Exception("Authentication class '$full_class_name' does not exist."); | ||
} | ||
|
||
throw new \Exception('Authentication not possible due to a configuration error.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace SynchWeb\Authentication\Type; | ||
|
||
use SynchWeb\Authentication\AuthenticationInterface; | ||
use SynchWeb\Authentication\AuthenticationParent; | ||
|
||
/** | ||
* Combined OIDC and CAS login to allow current api users to use the authentiate api | ||
* endpoint with username and password | ||
*/ | ||
class Combined extends AuthenticationParent implements AuthenticationInterface | ||
{ | ||
private $CASAuth; | ||
private $OIDCAuth; | ||
|
||
function __construct() { | ||
$this->CASAuth = new CAS(); | ||
$this->OIDCAuth = new OIDC(); | ||
} | ||
|
||
|
||
public function authenticate($login, $password) | ||
{ | ||
return $this->CASAuth->authenticate($login, $password); | ||
} | ||
|
||
public function check() { | ||
return $this->OIDCAuth->check(); | ||
} | ||
|
||
public function authorise() { | ||
return $this->OIDCAuth->authorise(); | ||
} | ||
|
||
public function authenticateByCode($code){ | ||
return $this->OIDCAuth->authenticateByCode($code); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.