| 1 |
<?php |
| 2 |
|
| 3 |
namespace Intervention\HttpAuth; |
| 4 |
|
| 5 |
class Key |
| 6 |
{ |
| 7 |
/** |
| 8 |
* Realm |
| 9 |
* |
| 10 |
* @var string |
| 11 |
*/ |
| 12 |
private $realm; |
| 13 |
|
| 14 |
/** |
| 15 |
* Username |
| 16 |
* |
| 17 |
* @var string |
| 18 |
*/ |
| 19 |
private $username; |
| 20 |
|
| 21 |
/** |
| 22 |
* Password |
| 23 |
* |
| 24 |
* @var string |
| 25 |
*/ |
| 26 |
private $password; |
| 27 |
|
| 28 |
/** |
| 29 |
* QOP |
| 30 |
* |
| 31 |
* @var string |
| 32 |
*/ |
| 33 |
private $qop; |
| 34 |
|
| 35 |
/** |
| 36 |
* Nonce |
| 37 |
* |
| 38 |
* @var string |
| 39 |
*/ |
| 40 |
private $nonce; |
| 41 |
|
| 42 |
/** |
| 43 |
* Opaque |
| 44 |
* |
| 45 |
* @var string |
| 46 |
*/ |
| 47 |
private $opaque; |
| 48 |
|
| 49 |
/** |
| 50 |
* NC |
| 51 |
* |
| 52 |
* @var string |
| 53 |
*/ |
| 54 |
private $nc; |
| 55 |
|
| 56 |
/** |
| 57 |
* uri |
| 58 |
* |
| 59 |
* @var string |
| 60 |
*/ |
| 61 |
private $uri; |
| 62 |
|
| 63 |
/** |
| 64 |
* cnonce |
| 65 |
* |
| 66 |
* @var string |
| 67 |
*/ |
| 68 |
private $cnonce; |
| 69 |
|
| 70 |
/** |
| 71 |
* Response |
| 72 |
* |
| 73 |
* @var string |
| 74 |
*/ |
| 75 |
private $response; |
| 76 |
|
| 77 |
public function getRealm() |
| 78 |
{ |
| 79 |
return $this->realm; |
| 80 |
} |
| 81 |
|
| 82 |
/** |
| 83 |
* Return current username |
| 84 |
* |
| 85 |
* @return string |
| 86 |
*/ |
| 87 |
public function getUsername() |
| 88 |
{ |
| 89 |
return $this->username; |
| 90 |
} |
| 91 |
|
| 92 |
/** |
| 93 |
* Return current password |
| 94 |
* |
| 95 |
* @return string |
| 96 |
*/ |
| 97 |
public function getPassword() |
| 98 |
{ |
| 99 |
return $this->password; |
| 100 |
} |
| 101 |
|
| 102 |
/** |
| 103 |
* Return current qop |
| 104 |
* |
| 105 |
* @return string |
| 106 |
*/ |
| 107 |
public function getQop() |
| 108 |
{ |
| 109 |
return $this->qop; |
| 110 |
} |
| 111 |
|
| 112 |
/** |
| 113 |
* Return current nonce |
| 114 |
* |
| 115 |
* @return string |
| 116 |
*/ |
| 117 |
public function getNonce() |
| 118 |
{ |
| 119 |
return $this->nonce; |
| 120 |
} |
| 121 |
|
| 122 |
/** |
| 123 |
* Return current opaque |
| 124 |
* |
| 125 |
* @return string |
| 126 |
*/ |
| 127 |
public function getOpaque() |
| 128 |
{ |
| 129 |
return $this->opaque; |
| 130 |
} |
| 131 |
|
| 132 |
/** |
| 133 |
* Return current uri |
| 134 |
* |
| 135 |
* @return string |
| 136 |
*/ |
| 137 |
public function getUri() |
| 138 |
{ |
| 139 |
return $this->uri; |
| 140 |
} |
| 141 |
|
| 142 |
/** |
| 143 |
* Return current nc |
| 144 |
* |
| 145 |
* @return string |
| 146 |
*/ |
| 147 |
public function getNc() |
| 148 |
{ |
| 149 |
return $this->nc; |
| 150 |
} |
| 151 |
|
| 152 |
/** |
| 153 |
* Return current cnonce |
| 154 |
* |
| 155 |
* @return string |
| 156 |
*/ |
| 157 |
public function getCnonce() |
| 158 |
{ |
| 159 |
return $this->cnonce; |
| 160 |
} |
| 161 |
|
| 162 |
/** |
| 163 |
* Return current response |
| 164 |
* |
| 165 |
* @return string |
| 166 |
*/ |
| 167 |
public function getResponse() |
| 168 |
{ |
| 169 |
return $this->response; |
| 170 |
} |
| 171 |
|
| 172 |
/** |
| 173 |
* Set property to given value on current instance |
| 174 |
* |
| 175 |
* @param string $name |
| 176 |
* @param mixed $value |
| 177 |
* @return Key |
| 178 |
*/ |
| 179 |
public function setProperty($name, $value): Key |
| 180 |
{ |
| 181 |
if (property_exists($this, $name)) { |
| 182 |
$this->{$name} = $value; |
| 183 |
} |
| 184 |
|
| 185 |
return $this; |
| 186 |
} |
| 187 |
} |
| 188 |
|