blob: e561de8dc0edaa0f608cedb51fd0f88a1b6beceb [file] [log] [blame]
Jun Choi4fc8b7812018-04-05 07:39:071// Copyright 2018 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
5#ifndef DEVICE_FIDO_GET_ASSERTION_REQUEST_HANDLER_H_
6#define DEVICE_FIDO_GET_ASSERTION_REQUEST_HANDLER_H_
7
8#include <memory>
9
10#include "base/callback.h"
11#include "base/macros.h"
12#include "base/memory/weak_ptr.h"
13#include "base/optional.h"
14#include "device/fido/ctap_get_assertion_request.h"
15#include "device/fido/fido_constants.h"
16#include "device/fido/fido_request_handler.h"
Jun Choib60937e2018-04-12 17:02:3817#include "device/fido/fido_transport_protocol.h"
Jun Choi4fc8b7812018-04-05 07:39:0718
19namespace service_manager {
20class Connector;
Nico Weber40cd26fd2019-02-09 17:37:0221} // namespace service_manager
Jun Choi4fc8b7812018-04-05 07:39:0722
23namespace device {
24
Martin Kreichgauer4a022e62018-05-09 20:53:1025class FidoAuthenticator;
Jun Choi4fc8b7812018-04-05 07:39:0726class AuthenticatorGetAssertionResponse;
27
Jun Choi4fc8b7812018-04-05 07:39:0728class COMPONENT_EXPORT(DEVICE_FIDO) GetAssertionRequestHandler
29 : public FidoRequestHandler<AuthenticatorGetAssertionResponse> {
30 public:
31 GetAssertionRequestHandler(
32 service_manager::Connector* connector,
Balazs Engedy159452d2018-08-16 15:18:1833 const base::flat_set<FidoTransportProtocol>& supported_transports,
Jun Choi4fc8b7812018-04-05 07:39:0734 CtapGetAssertionRequest request_parameter,
Martin Kreichgauerc6de3bc2018-11-13 03:14:0035 CompletionCallback completion_callback);
Jun Choi4fc8b7812018-04-05 07:39:0736 ~GetAssertionRequestHandler() override;
37
38 private:
39 // FidoRequestHandlerBase:
Martin Kreichgauer4a022e62018-05-09 20:53:1040 void DispatchRequest(FidoAuthenticator* authenticator) override;
Jun Choi4fc8b7812018-04-05 07:39:0741
Martin Kreichgauer8987fd02018-07-20 22:42:0342 void HandleResponse(
43 FidoAuthenticator* authenticator,
44 CtapDeviceResponseCode response_code,
45 base::Optional<AuthenticatorGetAssertionResponse> response);
46
Jun Choi4fc8b7812018-04-05 07:39:0747 CtapGetAssertionRequest request_;
48 base::WeakPtrFactory<GetAssertionRequestHandler> weak_factory_;
49
50 DISALLOW_COPY_AND_ASSIGN(GetAssertionRequestHandler);
51};
52
53} // namespace device
54
55#endif // DEVICE_FIDO_GET_ASSERTION_REQUEST_HANDLER_H_