Skip to content
Snippets Groups Projects
Commit b8724609 authored by Jaime Perez's avatar Jaime Perez
Browse files

Mark as deprecated in SimpleSAML_Session: DATA_TIMEOUT_LOGOUT, $authority,...

Mark as deprecated in SimpleSAML_Session: DATA_TIMEOUT_LOGOUT, $authority, getAuthority(), getAuthnRequest(), setAuthnRequest(), setIdP(), getIdP(), setSessionIndex(), getSessionIndex(), setNameID(), getNameID(), setSessionDuration(), remainingTime(), isAuthenticated(), getAuthnInstant(), getAttributes(), getAttribute(), setAttributes(), getSize(), expiraDataLogout(), setLogoutState(), getLogoutState().
parent 2635c663
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ class SimpleSAML_Session { ...@@ -17,6 +17,7 @@ class SimpleSAML_Session {
/** /**
* This is a timeout value for setData, which indicates that the data should be deleted * This is a timeout value for setData, which indicates that the data should be deleted
* on logout. * on logout.
* @deprecated
*/ */
const DATA_TIMEOUT_LOGOUT = 'logoutTimeout'; const DATA_TIMEOUT_LOGOUT = 'logoutTimeout';
...@@ -64,24 +65,27 @@ class SimpleSAML_Session { ...@@ -64,24 +65,27 @@ class SimpleSAML_Session {
* The track id is a new random unique identifier that is generated for each session. * The track id is a new random unique identifier that is generated for each session.
* This is used in the debug logs and error messages to easily track more information * This is used in the debug logs and error messages to easily track more information
* about what went wrong. * about what went wrong.
* *
* @var int * @var int
*/ */
private $trackid = 0; private $trackid = 0;
/**
* @deprecated
*/
private $authority = null; private $authority = null;
private $rememberMeExpire = null; private $rememberMeExpire = null;
/** /**
* Marks a session as modified, and therefore needs to be saved before destroying * Marks a session as modified, and therefore needs to be saved before destroying
* this object. * this object.
* *
* @var bool * @var bool
*/ */
private $dirty = false; private $dirty = false;
...@@ -131,8 +135,8 @@ class SimpleSAML_Session { ...@@ -131,8 +135,8 @@ class SimpleSAML_Session {
/** /**
* Private constructor that restricts instantiation to getInstance(). * Private constructor that restricts instantiation to getInstance().
* *
* @param boolean $transient Whether to create a transient session or not. * @param boolean $transient Whether to create a transient session or not.
*/ */
private function __construct($transient = FALSE) { private function __construct($transient = FALSE) {
...@@ -161,10 +165,10 @@ class SimpleSAML_Session { ...@@ -161,10 +165,10 @@ class SimpleSAML_Session {
} }
/** /**
* Destructor for this class. It will save the session to the session handler * Destructor for this class. It will save the session to the session handler
* in case the session has been marked as dirty. Do nothing otherwise. * in case the session has been marked as dirty. Do nothing otherwise.
*/ */
public function __destruct() { public function __destruct() {
if(!$this->dirty) { if(!$this->dirty) {
/* Session hasn't changed - don't bother saving it. */ /* Session hasn't changed - don't bother saving it. */
...@@ -191,8 +195,8 @@ class SimpleSAML_Session { ...@@ -191,8 +195,8 @@ class SimpleSAML_Session {
* Retrieves the current session. Will create a new session if there isn't a session. * Retrieves the current session. Will create a new session if there isn't a session.
* *
* @return SimpleSAML_Session The current session. * @return SimpleSAML_Session The current session.
* @throws Exception When session couldn't be initialized and * @throws Exception When session couldn't be initialized and
* the session fallback is disabled by configuration. * the session fallback is disabled by configuration.
*/ */
public static function getInstance() { public static function getInstance() {
...@@ -278,8 +282,8 @@ class SimpleSAML_Session { ...@@ -278,8 +282,8 @@ class SimpleSAML_Session {
/** /**
* Get a unique ID that will be permanent for this session. * Get a unique ID that will be permanent for this session.
* Used for debugging and tracing log files related to a session. * Used for debugging and tracing log files related to a session.
* *
* @return string The unique ID. * @return string The unique ID.
*/ */
public function getTrackID() { public function getTrackID() {
return $this->trackid; return $this->trackid;
...@@ -288,8 +292,9 @@ class SimpleSAML_Session { ...@@ -288,8 +292,9 @@ class SimpleSAML_Session {
/** /**
* Who authorized this session. Could be for example 'saml2', 'shib13', 'login', 'login-admin' etc. * Who authorized this session. Could be for example 'saml2', 'shib13', 'login', 'login-admin' etc.
* *
* @return string Who authorized this session. * @return string Who authorized this session.
* @deprecated
*/ */
public function getAuthority() { public function getAuthority() {
return $this->authority; return $this->authority;
...@@ -306,6 +311,7 @@ class SimpleSAML_Session { ...@@ -306,6 +311,7 @@ class SimpleSAML_Session {
* @throws Exception If the method can't find a cached version of the request. * @throws Exception If the method can't find a cached version of the request.
* @return array Returns an assoc array of cached variables associated with the * @return array Returns an assoc array of cached variables associated with the
* authentication request. * authentication request.
* @deprecated
*/ */
public function getAuthnRequest($protocol, $requestid) { public function getAuthnRequest($protocol, $requestid) {
...@@ -335,6 +341,7 @@ class SimpleSAML_Session { ...@@ -335,6 +341,7 @@ class SimpleSAML_Session {
* @param string $protocol 'saml2' or 'shib13' * @param string $protocol 'saml2' or 'shib13'
* @param string $requestid The request id used as a key to lookup the cache. * @param string $requestid The request id used as a key to lookup the cache.
* @param array $cache The assoc array that will be stored. * @param array $cache The assoc array that will be stored.
* @deprecated
*/ */
public function setAuthnRequest($protocol, $requestid, array $cache) { public function setAuthnRequest($protocol, $requestid, array $cache) {
...@@ -350,6 +357,7 @@ class SimpleSAML_Session { ...@@ -350,6 +357,7 @@ class SimpleSAML_Session {
* Set the IdP we are authenticated against. * Set the IdP we are authenticated against.
* *
* @param string|NULL $idp Our current IdP, or NULL if we aren't authenticated with an IdP. * @param string|NULL $idp Our current IdP, or NULL if we aren't authenticated with an IdP.
* @deprecated
*/ */
public function setIdP($idp) { public function setIdP($idp) {
assert('is_string($idp) || is_null($idp)'); assert('is_string($idp) || is_null($idp)');
...@@ -370,6 +378,7 @@ class SimpleSAML_Session { ...@@ -370,6 +378,7 @@ class SimpleSAML_Session {
* Retrieve the IdP we are currently authenticated against. * Retrieve the IdP we are currently authenticated against.
* *
* @return string|NULL Our current IdP, or NULL if we aren't authenticated with an IdP. * @return string|NULL Our current IdP, or NULL if we aren't authenticated with an IdP.
* @deprecated
*/ */
public function getIdP() { public function getIdP() {
if (!isset($this->authData[$this->authority]['saml:sp:IdP'])) { if (!isset($this->authData[$this->authority]['saml:sp:IdP'])) {
...@@ -383,6 +392,7 @@ class SimpleSAML_Session { ...@@ -383,6 +392,7 @@ class SimpleSAML_Session {
* Set the SessionIndex we received from our IdP. * Set the SessionIndex we received from our IdP.
* *
* @param string|NULL $sessionindex Our SessionIndex. * @param string|NULL $sessionindex Our SessionIndex.
* @deprecated
*/ */
public function setSessionIndex($sessionindex) { public function setSessionIndex($sessionindex) {
assert('is_string($sessionindex) || is_null($sessionindex)'); assert('is_string($sessionindex) || is_null($sessionindex)');
...@@ -402,6 +412,7 @@ class SimpleSAML_Session { ...@@ -402,6 +412,7 @@ class SimpleSAML_Session {
* Retrieve our SessionIndex. * Retrieve our SessionIndex.
* *
* @return string|NULL Our SessionIndex. * @return string|NULL Our SessionIndex.
* @deprecated
*/ */
public function getSessionIndex() { public function getSessionIndex() {
if (!isset($this->authData[$this->authority]['saml:sp:SessionIndex'])) { if (!isset($this->authData[$this->authority]['saml:sp:SessionIndex'])) {
...@@ -415,6 +426,7 @@ class SimpleSAML_Session { ...@@ -415,6 +426,7 @@ class SimpleSAML_Session {
* Set our current NameID. * Set our current NameID.
* *
* @param array|NULL $nameid The NameID we received from the IdP * @param array|NULL $nameid The NameID we received from the IdP
* @deprecated
*/ */
public function setNameID($nameid) { public function setNameID($nameid) {
assert('is_array($nameid) || is_null($nameid)'); assert('is_array($nameid) || is_null($nameid)');
...@@ -434,6 +446,7 @@ class SimpleSAML_Session { ...@@ -434,6 +446,7 @@ class SimpleSAML_Session {
* Get our NameID. * Get our NameID.
* *
* @return array|NULL The NameID we received from the IdP. * @return array|NULL The NameID we received from the IdP.
* @deprecated
*/ */
public function getNameID() { public function getNameID() {
if (!isset($this->authData[$this->authority]['saml:sp:NameID'])) { if (!isset($this->authData[$this->authority]['saml:sp:NameID'])) {
...@@ -613,6 +626,7 @@ class SimpleSAML_Session { ...@@ -613,6 +626,7 @@ class SimpleSAML_Session {
* Set the lifetime of our current authentication session. * Set the lifetime of our current authentication session.
* *
* @param int $duration The number of seconds this authentication session is valid. * @param int $duration The number of seconds this authentication session is valid.
* @deprecated
*/ */
public function setSessionDuration($duration) { public function setSessionDuration($duration) {
assert('is_int($duration)'); assert('is_int($duration)');
...@@ -656,6 +670,7 @@ class SimpleSAML_Session { ...@@ -656,6 +670,7 @@ class SimpleSAML_Session {
* If the user is authenticated, how much time is left of the session. * If the user is authenticated, how much time is left of the session.
* *
* @return int The number of seconds until the session expires. * @return int The number of seconds until the session expires.
* @deprecated
*/ */
public function remainingTime() { public function remainingTime() {
...@@ -672,6 +687,7 @@ class SimpleSAML_Session { ...@@ -672,6 +687,7 @@ class SimpleSAML_Session {
* Is the user authenticated. This function does not check the session duration. * Is the user authenticated. This function does not check the session duration.
* *
* @return bool TRUE if the user is authenticated, FALSE otherwise. * @return bool TRUE if the user is authenticated, FALSE otherwise.
* @deprecated
*/ */
public function isAuthenticated() { public function isAuthenticated() {
return isset($this->authData[$this->authority]); return isset($this->authData[$this->authority]);
...@@ -682,6 +698,7 @@ class SimpleSAML_Session { ...@@ -682,6 +698,7 @@ class SimpleSAML_Session {
* Retrieve the time the user was authenticated. * Retrieve the time the user was authenticated.
* *
* @return int|NULL The timestamp for when the user was authenticated. NULL if the user hasn't authenticated. * @return int|NULL The timestamp for when the user was authenticated. NULL if the user hasn't authenticated.
* @deprecated
*/ */
public function getAuthnInstant() { public function getAuthnInstant() {
...@@ -699,6 +716,7 @@ class SimpleSAML_Session { ...@@ -699,6 +716,7 @@ class SimpleSAML_Session {
* Retrieve the attributes associated with this session. * Retrieve the attributes associated with this session.
* *
* @return array|NULL The attributes. * @return array|NULL The attributes.
* @deprecated
*/ */
public function getAttributes() { public function getAttributes() {
if (!isset($this->authData[$this->authority]['Attributes'])) { if (!isset($this->authData[$this->authority]['Attributes'])) {
...@@ -713,6 +731,7 @@ class SimpleSAML_Session { ...@@ -713,6 +731,7 @@ class SimpleSAML_Session {
* *
* @param string $name The name of the attribute. * @param string $name The name of the attribute.
* @return array|NULL The values of the given attribute. * @return array|NULL The values of the given attribute.
* @deprecated
*/ */
public function getAttribute($name) { public function getAttribute($name) {
if (!isset($this->authData[$this->authority]['Attributes'][$name])) { if (!isset($this->authData[$this->authority]['Attributes'][$name])) {
...@@ -726,6 +745,7 @@ class SimpleSAML_Session { ...@@ -726,6 +745,7 @@ class SimpleSAML_Session {
* Set the attributes for this session. * Set the attributes for this session.
* *
* @param array|NULL $attributes The attributes of this session. * @param array|NULL $attributes The attributes of this session.
* @deprecated
*/ */
public function setAttributes($attributes) { public function setAttributes($attributes) {
assert('isset($this->authData[$this->authority])'); assert('isset($this->authData[$this->authority])');
...@@ -753,6 +773,7 @@ class SimpleSAML_Session { ...@@ -753,6 +773,7 @@ class SimpleSAML_Session {
* Calculates the size of the session object after serialization * Calculates the size of the session object after serialization
* *
* @return int The size of the session measured in bytes. * @return int The size of the session measured in bytes.
* @deprecated
*/ */
public function getSize() { public function getSize() {
$s = serialize($this); $s = serialize($this);
...@@ -765,7 +786,7 @@ class SimpleSAML_Session { ...@@ -765,7 +786,7 @@ class SimpleSAML_Session {
* *
* @param string $classname The class which contains the logout handler. * @param string $classname The class which contains the logout handler.
* @param string $functionname The logout handler function. * @param string $functionname The logout handler function.
* @throws Exception If the handler is not a valid function or method. * @throws Exception If the handler is not a valid function or method.
*/ */
public function registerLogoutHandler($classname, $functionname) { public function registerLogoutHandler($classname, $functionname) {
assert('isset($this->authData[$this->authority])'); assert('isset($this->authData[$this->authority])');
...@@ -787,7 +808,7 @@ class SimpleSAML_Session { ...@@ -787,7 +808,7 @@ class SimpleSAML_Session {
* This function calls all registered logout handlers. * This function calls all registered logout handlers.
* *
* @param string $authority The authentication source we are logging out from. * @param string $authority The authentication source we are logging out from.
* @throws Exception If the handler is not a valid function or method. * @throws Exception If the handler is not a valid function or method.
*/ */
private function callLogoutHandlers($authority) { private function callLogoutHandlers($authority) {
assert('is_string($authority)'); assert('is_string($authority)');
...@@ -854,6 +875,7 @@ class SimpleSAML_Session { ...@@ -854,6 +875,7 @@ class SimpleSAML_Session {
/** /**
* This function deletes data which should be deleted on logout from the data store. * This function deletes data which should be deleted on logout from the data store.
* @deprecated
*/ */
private function expireDataLogout() { private function expireDataLogout() {
...@@ -1116,6 +1138,7 @@ class SimpleSAML_Session { ...@@ -1116,6 +1138,7 @@ class SimpleSAML_Session {
* Set the logout state for this session. * Set the logout state for this session.
* *
* @param array $state The state array. * @param array $state The state array.
* @deprecated
*/ */
public function setLogoutState(array $state) { public function setLogoutState(array $state) {
assert('isset($this->authData[$this->authority])'); assert('isset($this->authData[$this->authority])');
...@@ -1129,6 +1152,7 @@ class SimpleSAML_Session { ...@@ -1129,6 +1152,7 @@ class SimpleSAML_Session {
* Retrieve the logout state for this session. * Retrieve the logout state for this session.
* *
* @return array The logout state. If no logout state is set, an empty array will be returned. * @return array The logout state. If no logout state is set, an empty array will be returned.
* @deprecated
*/ */
public function getLogoutState() { public function getLogoutState() {
assert('isset($this->authData[$this->authority])'); assert('isset($this->authData[$this->authority])');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment