Details
-
Improvement
-
Status: Resolved
-
Blocker
-
Resolution: Implemented
-
None
-
None
-
None
-
Mesosphere Q4 Sprint 2 - 11/14
Description
Motivation
Design an interface covering authenticator modules while staying minimal invasive in regards to changes on the existing flat-file Authenticator implementation.
Status Quo
The current sasl based, "flat-file" Authenticator ( sasl/authenticator.hpp ) is spawning a (libprocess) process in its constructor and demands the authentication client process UPID as a parameter - not a perfect fit for the current Module API as that one does only allow default constructors.
Design
Instead of wrapping the flat-file Authenticator with yet another class that satisfies a proper interface design, we might just as well slightly change the current design into a feasible interface, no?
I would like to propose this:
class Authenticator { public: Authenticator() {} virtual ~Authenticator() {} virtual Option<Error> initialize(const process::UPID& clientPid, const Option<Credentials>& credentials) = 0; virtual process::Future<Option<std::string> > authenticate(void) = 0; };
As a result, the flat-file authenticator would spawn its process within that proposed initialize method and not within the constructor already.