1 /*
2  * hunt-proton: AMQP Protocol library for D programming language.
3  *
4  * Copyright (C) 2018-2019 HuntLabs
5  *
6  * Website: https://www.huntlabs.net/
7  *
8  * Licensed under the Apache-2.0 License.
9  *
10  */
11 
12 module hunt.proton.engine.SaslListener;
13 import hunt.proton.engine.Transport;
14 import hunt.proton.engine.Sasl;
15 /**
16  * Listener for SASL frame arrival to facilitate relevant handling for the SASL
17  * negotiation.
18  *
19  * See the AMQP specification
20  * <a href="http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-security-v1.0-os.html#doc-idp51040">
21  * SASL negotiation process</a> overview for related detail.
22  */
23 interface SaslListener {
24 
25     /**
26      * Called when a sasl-mechanisms frame has arrived and its effect
27      * applied, indicating the offered mechanisms sent by the 'server' peer.
28      *
29      * @param sasl the Sasl object
30      * @param transport the related transport
31      */
32     void onSaslMechanisms(Sasl sasl, Transport transport);
33 
34     /**
35      * Called when a sasl-init frame has arrived and its effect
36      * applied, indicating the selected mechanism and any hostname
37      * and initial-response details from the 'client' peer.
38      *
39      * @param sasl the Sasl object
40      * @param transport the related transport
41      */
42     void onSaslInit(Sasl sasl, Transport transport);
43 
44     /**
45      * Called when a sasl-challenge frame has arrived and its effect
46      * applied, indicating the challenge sent by the 'server' peer.
47      *
48      * @param sasl the Sasl object
49      * @param transport the related transport
50      */
51     void onSaslChallenge(Sasl sasl, Transport transport);
52 
53     /**
54      * Called when a sasl-response frame has arrived and its effect
55      * applied, indicating the response sent by the 'client' peer.
56      *
57      * @param sasl the Sasl object
58      * @param transport the related transport
59      */
60     void onSaslResponse(Sasl sasl, Transport transport);
61 
62     /**
63      * Called when a sasl-outcome frame has arrived and its effect
64      * applied, indicating the outcome and any success additional-data
65      * sent by the 'server' peer.
66      *
67      * @param sasl the Sasl object
68      * @param transport the related transport
69      */
70     void onSaslOutcome(Sasl sasl, Transport transport);
71 }