forked from yokai-php/security-token-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TokenEvents.php
136 lines (125 loc) · 4.57 KB
/
TokenEvents.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
namespace Yokai\SecurityTokenBundle;
/**
* @author Yann Eugoné <eugone.yann@gmail.com>
*/
final class TokenEvents
{
/**
* The CREATE_TOKEN event occurs before a token is created.
*
* This event allows you to determine token payload.
* The event listener method receives a Yokai\SecurityTokenBundle\Event\CreateTokenEvent instance.
*
* @Event
*
* @var string
*/
const CREATE_TOKEN = 'yokai_security_yoken.create_token';
/**
* The TOKEN_CREATED event occurs after a token is created.
*
* This event allows you to do be notified of successful token creations.
* The event listener method receives a Yokai\SecurityTokenBundle\Event\TokenCreatedEvent instance.
*
* @Event
*
* @var string
*/
const TOKEN_CREATED = 'yokai_security_yoken.token_created';
/**
* The CONSUME_TOKEN event occurs before a token is consumed.
*
* This event allows you determine token usage information.
* The event listener method receives a Yokai\SecurityTokenBundle\Event\ConsumeTokenEvent instance.
*
* @Event
*
* @var string
*/
const CONSUME_TOKEN = 'yokai_security_yoken.consume_token';
/**
* The TOKEN_CONSUMED event occurs after a token is consumed.
*
* This event allows you to do be notified of successful token consumptions.
* The event listener method receives a Yokai\SecurityTokenBundle\Event\TokenConsumedEvent instance.
*
* @Event
*
* @var string
*/
const TOKEN_CONSUMED = 'yokai_security_yoken.token_consumed';
/**
* The TOKEN_TOTALLY_CONSUMED event occurs after a token is totally consumed (no more usages allowed on this token).
*
* This event allows you to do be notified of successful token consumptions.
* The event listener method receives a Yokai\SecurityTokenBundle\Event\TokenTotallyConsumed instance.
*
* @Event
*
* @var string
*/
const TOKEN_TOTALLY_CONSUMED = 'yokai_security_yoken.token_used';
/**
* The TOKEN_RETRIEVED event occurs whenever the Yokai\SecurityTokenBundle\Manager\TokenManagerInterface
* is returning a token.
*
* This event allows you to do be notified of token request that succeed.
* The event listener method receives a Yokai\SecurityTokenBundle\Event\TokenRetrievedEvent instance.
*
* @Event
*
* @var string
*/
const TOKEN_RETRIEVED = 'yokai_security_yoken.token_retrieved';
/**
* The TOKEN_NOT_FOUND event occurs whenever the Yokai\SecurityTokenBundle\Manager\TokenManagerInterface
* throw a Yokai\SecurityTokenBundle\Exception\TokenNotFoundException.
*
* This event allows you to do be notified of token request that fail to not found.
* The event listener method receives a Yokai\SecurityTokenBundle\Event\TokenNotFoundEvent instance.
*
* @Event
*
* @var string
*/
const TOKEN_NOT_FOUND = 'yokai_security_yoken.token_not_found';
/**
* The TOKEN_EXPIRED event occurs whenever the Yokai\SecurityTokenBundle\Manager\TokenManagerInterface
* throw a Yokai\SecurityTokenBundle\Exception\TokenExpiredException.
*
* This event allows you to do be notified of token request that fail to expired.
* The event listener method receives a Yokai\SecurityTokenBundle\Event\TokenExpiredEvent instance.
*
* @Event
*
* @var string
*/
const TOKEN_EXPIRED = 'yokai_security_yoken.token_expired';
/**
* @deprecated since 2.3 to be removed in 3.0. Use TOKEN_ALREADY_CONSUMED instead.
*
* The TOKEN_USED event occurs whenever the Yokai\SecurityTokenBundle\Manager\TokenManagerInterface
* throw a Yokai\SecurityTokenBundle\Exception\TokenUsedException.
*
* This event allows you to do be notified of token request that fail to used.
* The event listener method receives a Yokai\SecurityTokenBundle\Event\TokenUsedEvent instance.
*
* @Event
*
* @var string
*/
const TOKEN_USED = 'yokai_security_yoken.token_used';
/**
* The TOKEN_ALREADY_CONSUMED event occurs whenever the Yokai\SecurityTokenBundle\Manager\TokenManagerInterface
* throw a Yokai\SecurityTokenBundle\Exception\TokenConsumedException.
*
* This event allows you to do be notified of token request that fail to used.
* The event listener method receives a Yokai\SecurityTokenBundle\Event\TokenAlreadyConsumedEvent instance.
*
* @Event
*
* @var string
*/
const TOKEN_ALREADY_CONSUMED = 'yokai_security_yoken.token_already_consumed';
}