Comments (12)
Yes, if it breaks compatibility, it'd have bump to a new major version. I'm ok with that. ;-)
from aura.auth.
I think that would mean separate interface packages and therefore 3.x bump.
from aura.auth.
@cxj looking for this now ?
https://github.com/friendsofaura/FOA.Auth_Session_Bundle ( 3 years old, so not sure if all is working as expected. Have not tested those now )
There is already one ;-) .
from aura.auth.
I think if Aura.Auth just used a compatible API (PHP interface) to its included Session class, then users of it could optionally and easily plug in Aura.Session to get its greater functionality. That would allow Aura.Auth to remain a standalone and not be dependent on anything.
from aura.auth.
@cxj I do agree. See discussion on google group regarding the topic : https://groups.google.com/d/msg/auraphp/dVpSOV6RnM4/HWynJROLm-gJ .
from aura.auth.
It appears that Aura.Session's SegmentInterface
and Aura.Auth's SegmentInterface
are currently 100% compatible, with Aura.Auth's being a subset of the Aura. Session's.
Aura.Auth:
$ fgrep function SegmentInterface.php
public function get($key, $alt = null);
public function set($key, $val);
Aura.Session:
$ fgrep function SegmentInterface.php
public function get($key, $alt = null);
public function set($key, $val);
public function clear();
public function setFlash($key, $val);
public function getFlash($key, $alt = null);
public function clearFlash();
public function getFlashNext($key, $alt = null);
public function setFlashNow($key, $val);
public function clearFlashNow();
public function keepFlash();
from aura.auth.
Aura.Session strangely does not have an interface definition for the Session
class, while Aura.Auth does. However, the Aura\Session\Sesssion
class appears to be compatible with Aura\Auth\Session\SessionInterface
.
Aura\Auth:
$ fgrep function SessionInterface.php
public function start();
public function resume();
public function regenerateId();
Aura\Session:
$ fgrep 'public function' Session.php
public function __construct(
public function setDeleteCookie($delete_cookie)
public function getSegment($name)
public function isResumable()
public function isStarted()
public function start() // match
public function resume() // match
public function clear()
public function commit()
public function destroy()
public function getCsrfToken()
public function setCacheExpire($expire)
public function getCacheExpire()
public function setCacheLimiter($limiter)
public function getCacheLimiter()
public function setCookieParams(array $params)
public function getCookieParams()
public function getId()
public function regenerateId() // match
public function setName($name)
public function getName()
public function setSavePath($path)
public function getSavePath()
from aura.auth.
A problem might be the constructors for the Session
class. Perhaps some clever use of a Dependency Injection Container might solve this, however.
Aura.Auth:
public function __construct(array $cookie)
Aura.Session:
public function __construct(
SegmentFactory $segment_factory,
CsrfTokenFactory $csrf_token_factory,
Phpfunc $phpfunc,
array $cookies = array(),
$delete_cookie = null
)
from aura.auth.
Another problem is that Auth\Auth\AuthFactory
takes a Segment
in its constructor, while Aura\Session\Session
expects to generate its own Segment
s using a SegmentFactory
:
public function __construct(
array $cookie,
SessionInterface $session = null,
SegmentInterface $segment = null
)
from aura.auth.
Constructor is never a problem if the interfaces satisfies. We can create a separate interface package as https://github.com/auraphp/Aura.Filter_Interface . And this doesn't need all those methods, but very limited / commonly used. Rest of it can be in package level itself.
from aura.auth.
It does not appear that Aura\Filter
makes use of Aura\Filter_Interface
. For an interface package to be useful, don't we need to have implementations which actually conform to it by using the PHP implements
keyword?
If I understand correctly, to do what you are suggesting, there needs to be a new auraphp package named Aura.Session_Interface
, correct? If so, can you create that? I do not have commit access to the auraphp project.
Or perhaps there should be just one auraphp Interfaces
repository, where interfaces for all of the subprojects are defined. For example:
auraphp/Interfaces
contains:
Aura\Interfaces\Filter_Interface
Aura\Interfaces\FailureCollectionInterface
Aura\Interfaces\Payload_Interface
Aura\Interfaces\Session_Interface
Aura\Interfaces\Segment_Interface
Then Aura\Auth\Session
could implement Aura\Interfaces\Session_Interface
, etc.
from aura.auth.
May be we need to ping @pmjones regarding the thoughts expressed here. So he can create the repository. I don't have access for it.
from aura.auth.
Related Issues (20)
- 4.0.0 Release? HOT 2
- PHP 7.4 compatibility HOT 3
- Add ldap bind user HOT 13
- Release and without fear to use HOT 1
- PDO: Thrown exception error messages HOT 6
- Auth object calling session_start HOT 1
- Rehash HOT 2
- Does HtpasswordVerifier need to verify the password hash is buggy and using bcrypt ? HOT 1
- Better ways to handle brute force attack
- Sessions, remember me functionality and other things. HOT 1
- Can't use minimum-stability: stable with this package HOT 2
- Adapter in resume HOT 1
- Probably good to have messages passed for Exceptions ? HOT 3
- LdapAdapter::bind performs a double unbind on the underlying ldap resource HOT 2
- Default timeout values HOT 3
- Missing return values, or changed API and docblock out of date? HOT 4
- Unable to logout HOT 1
- If password changes, session is still valid. HOT 4
- New release builds, please? HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aura.auth.