Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Commit 7b0da3d

Browse files
author
Brian Retterer
committed
Merge branch 'release/1.16.0'
2 parents 28807c0 + 0398116 commit 7b0da3d

32 files changed

+2276
-12
lines changed

CHANGES.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@ stormpath-sdk-php Changelog
22
===========================
33

44

5+
Version 1.16.0
6+
--------------
7+
8+
Released on July 20, 2016
9+
10+
- Fix cache key for resources
11+
- Adds method for getting access to the password modified at property off account
12+
- Work with Password Policy from Directory
13+
- Password Reuse policy
14+
- Adds ability to work with all email templates
15+
- Now able to add an account directly from the organization resource
16+
- Create and work with email blacklist and whitelist.
17+
- Request ID now part of the resource error and error
18+
- Name and Description can be added to API Keys
19+
520
Version 1.15.0
621
--------------
722

src/Cache/PSR6CacheKeyTrait.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ protected function createCacheKey($href, $query = null, $options = [])
88
{
99
if (is_array($query)) {
1010
ksort($query);
11+
foreach ($query as $key => $value) {
12+
$query[$key] = (string) $value;
13+
}
1114
$query = http_build_query($query);
1215
}
1316
$key = $href.'?'.$query;

src/DataStore/DefaultDataStore.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,14 @@ private function toStdClass(Resource $resource, $customData = false)
353353
$property = $resource->getProperty($name);
354354

355355
$nameIsCustomData = $name == CustomData::CUSTOMDATA_PROP_NAME;
356+
$nameIsDefaultModel = $name == 'defaultModel';
356357

357358
if ($property instanceof \Stormpath\Resource\CustomData)
358359
{
359360
$property = $this->toStdClass($property, true);
360361
}
361362

362-
else if ($property instanceof \stdClass && $customData === false && !$nameIsCustomData)
363+
else if ($property instanceof \stdClass && $customData === false && !$nameIsCustomData && !$nameIsDefaultModel)
363364
{
364365
$property = $this->toSimpleReference($name, $property);
365366
}

src/Directory/PasswordPolicy.php

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?php
2+
3+
/*
4+
* Copyright 2016 Stormpath, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
namespace Stormpath\Directory;
20+
21+
use Stormpath\Client;
22+
use Stormpath\Resource\InstanceResource;
23+
use Stormpath\Stormpath;
24+
25+
class PasswordPolicy extends InstanceResource
26+
{
27+
const RESET_TOKEN_TTL = "resetTokenTtl";
28+
const PASSWORD_STRENGTH = "strength";
29+
const RESET_EMAIL_STATUS = "resetEmailStatus";
30+
const RESET_EMAIL_TEMPLATES = "resetEmailTemplates";
31+
const RESET_SUCCESS_EMAIL_STATUS = "resetSuccessEmailStatus";
32+
const RESET_SUCCESS_EMAIL_TEMPLATES = "resetSuccessEmailTemplates";
33+
34+
const PATH = 'passwordPolicies';
35+
36+
public static function get($href, array $options = [])
37+
{
38+
return Client::get($href, Stormpath::PASSWORD_POLICY, self::PATH, $options);
39+
}
40+
41+
public function getResetTokenTtl()
42+
{
43+
return $this->getProperty(self::RESET_TOKEN_TTL);
44+
}
45+
46+
public function setResetTokenTtl($ttl)
47+
{
48+
$this->setProperty(self::RESET_TOKEN_TTL, $ttl);
49+
}
50+
51+
public function getResetEmailStatus()
52+
{
53+
return $this->getProperty(self::RESET_EMAIL_STATUS);
54+
}
55+
56+
public function setResetEmailStatus($ttl)
57+
{
58+
$this->setProperty(self::RESET_EMAIL_STATUS, $ttl);
59+
}
60+
61+
public function getResetSuccessEmailStatus()
62+
{
63+
return $this->getProperty(self::RESET_EMAIL_STATUS);
64+
}
65+
66+
public function setResetSuccessEmailStatus($ttl)
67+
{
68+
$this->setProperty(self::RESET_EMAIL_STATUS, $ttl);
69+
}
70+
71+
public function getStrength(array $options = [])
72+
{
73+
return $this->getResourceProperty(self::PASSWORD_STRENGTH, Stormpath::PASSWORD_STRENGTH, $options);
74+
}
75+
76+
public function getResetEmailTemplates(array $options = [])
77+
{
78+
return $this->getResourceProperty(self::RESET_EMAIL_TEMPLATES, Stormpath::MODELED_EMAIL_TEMPLATE_LIST, $options);
79+
}
80+
81+
public function getResetSuccessEmailTemplates(array $options = [])
82+
{
83+
return $this->getResourceProperty(self::RESET_SUCCESS_EMAIL_TEMPLATES, Stormpath::UNMODELED_EMAIL_TEMPLATE_LIST, $options);
84+
}
85+
86+
87+
}

src/Directory/PasswordStrength.php

Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
<?php
2+
/*
3+
* Copyright 2016 Stormpath, Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
namespace Stormpath\Directory;
19+
20+
use Stormpath\Client;
21+
use Stormpath\Resource\InstanceResource;
22+
use Stormpath\Stormpath;
23+
24+
class PasswordStrength extends InstanceResource
25+
{
26+
const HREF = "href";
27+
const MIN_LENGTH = "minLength";
28+
const MAX_LENGTH = "maxLength";
29+
const MIN_NUMERIC = "minNumeric";
30+
const MIN_SYMBOL = "minSymbol";
31+
const MIN_DIACRITIC = "minDiacritic";
32+
const PREVENT_REUSE = "preventReuse";
33+
const MIN_LOWER_CASE = "minLowerCase";
34+
const MIN_UPPER_CASE = "minUpperCase";
35+
36+
const PATH = "strength";
37+
38+
39+
public static function get($href, array $options = [])
40+
{
41+
return Client::get($href, Stormpath::PASSWORD_STRENGTH, self::PATH, $options);
42+
}
43+
/**
44+
* Gets the href property
45+
*
46+
* @return string
47+
*/
48+
public function getHref()
49+
{
50+
return $this->getProperty(self::HREF);
51+
}
52+
/**
53+
* Gets the minLength property
54+
*
55+
* @return integer
56+
*/
57+
public function getMinLength()
58+
{
59+
return $this->getProperty(self::MIN_LENGTH);
60+
}
61+
62+
/**
63+
* Sets the minLength property
64+
*
65+
* @param integer $minLength The minLength of the object
66+
* @return self
67+
*/
68+
public function setMinLength($minLength)
69+
{
70+
$this->setProperty(self::MIN_LENGTH, $minLength);
71+
72+
return $this;
73+
}
74+
75+
76+
/**
77+
* Gets the maxLength property
78+
*
79+
* @return integer
80+
*/
81+
public function getMaxLength()
82+
{
83+
return $this->getProperty(self::MAX_LENGTH);
84+
}
85+
86+
/**
87+
* Sets the maxLength property
88+
*
89+
* @param integer $maxLength The maxLength of the object
90+
* @return self
91+
*/
92+
public function setMaxLength($maxLength)
93+
{
94+
$this->setProperty(self::MAX_LENGTH, $maxLength);
95+
96+
return $this;
97+
}
98+
99+
/**
100+
* Gets the minLowerCase property
101+
*
102+
* @return integer
103+
*/
104+
public function getMinLowerCase()
105+
{
106+
return $this->getProperty(self::MIN_LOWER_CASE);
107+
}
108+
109+
/**
110+
* Sets the minLowerCase property
111+
*
112+
* @param integer $minLowerCase The minLowerCase of the object
113+
* @return self
114+
*/
115+
public function setMinLowerCase($minLowerCase)
116+
{
117+
$this->setProperty(self::MIN_LOWER_CASE, $minLowerCase);
118+
119+
return $this;
120+
}
121+
122+
/**
123+
* Gets the minUpperCase property
124+
*
125+
* @return integer
126+
*/
127+
public function getMinUpperCase()
128+
{
129+
return $this->getProperty(self::MIN_UPPER_CASE);
130+
}
131+
132+
/**
133+
* Sets the minUpperCase property
134+
*
135+
* @param integer $minUpperCase The minUpperCase of the object
136+
* @return self
137+
*/
138+
public function setMinUpperCase($minUpperCase)
139+
{
140+
$this->setProperty(self::MIN_UPPER_CASE, $minUpperCase);
141+
142+
return $this;
143+
}
144+
145+
/**
146+
* Gets the minNumeric property
147+
*
148+
* @return integer
149+
*/
150+
public function getMinNumeric()
151+
{
152+
return $this->getProperty(self::MIN_NUMERIC);
153+
}
154+
155+
/**
156+
* Sets the minNumeric property
157+
*
158+
* @param integer $minNumeric The minNumeric of the object
159+
* @return self
160+
*/
161+
public function setMinNumeric($minNumeric)
162+
{
163+
$this->setProperty(self::MIN_NUMERIC, $minNumeric);
164+
165+
return $this;
166+
}
167+
168+
/**
169+
* Gets the minSymbol property
170+
*
171+
* @return integer
172+
*/
173+
public function getMinSymbol()
174+
{
175+
return $this->getProperty(self::MIN_SYMBOL);
176+
}
177+
178+
/**
179+
* Sets the minSymbol property
180+
*
181+
* @param integer $minSymbol The minSymbol of the object
182+
* @return self
183+
*/
184+
public function setMinSymbol($minSymbol)
185+
{
186+
$this->setProperty(self::MIN_SYMBOL, $minSymbol);
187+
188+
return $this;
189+
}
190+
191+
/**
192+
* Gets the minDiacritic property
193+
*
194+
* @return integer
195+
*/
196+
public function getMinDiacritic()
197+
{
198+
return $this->getProperty(self::MIN_DIACRITIC);
199+
}
200+
201+
/**
202+
* Sets the minDiacritic property
203+
*
204+
* @param integer $minDiacritic The minDiacritic of the object
205+
* @return self
206+
*/
207+
public function setMinDiacritic($minDiacritic)
208+
{
209+
$this->setProperty(self::MIN_DIACRITIC, $minDiacritic);
210+
211+
return $this;
212+
}
213+
214+
/**
215+
* Gets the preventReuse property
216+
*
217+
* @return integer
218+
*/
219+
public function getPreventReuse()
220+
{
221+
return $this->getProperty(self::PREVENT_REUSE);
222+
}
223+
224+
/**
225+
* Sets the preventReuse property
226+
*
227+
* @param integer $preventReuse The preventReuse of the object
228+
* @return self
229+
*/
230+
public function setPreventReuse($preventReuse)
231+
{
232+
$this->setProperty(self::PREVENT_REUSE, $preventReuse);
233+
234+
return $this;
235+
}
236+
237+
}

0 commit comments

Comments
 (0)