pam_authorization_factory_posix.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef REMOTING_HOST_PAM_AUTHORIZATION_FACTORY_POSIX_H_
  5. #define REMOTING_HOST_PAM_AUTHORIZATION_FACTORY_POSIX_H_
  6. #include <memory>
  7. #include "remoting/protocol/authenticator.h"
  8. // PamAuthorizationFactory abuses the AuthenticatorFactory interface to apply
  9. // PAM-based authorization on top of some underlying authentication scheme.
  10. namespace remoting {
  11. class PamAuthorizationFactory : public protocol::AuthenticatorFactory {
  12. public:
  13. PamAuthorizationFactory(
  14. std::unique_ptr<protocol::AuthenticatorFactory> underlying);
  15. ~PamAuthorizationFactory() override;
  16. std::unique_ptr<protocol::Authenticator> CreateAuthenticator(
  17. const std::string& local_jid,
  18. const std::string& remote_jid) override;
  19. private:
  20. std::unique_ptr<protocol::AuthenticatorFactory> underlying_;
  21. };
  22. } // namespace remoting
  23. #endif // REMOTING_HOST_PAM_AUTHORIZATION_FACTORY_POSIX_H_