Skip to content

Commit

Permalink
Merge pull request #684 from codeigniter4/develop
Browse files Browse the repository at this point in the history
1.0.0-beta.5 Ready code
  • Loading branch information
kenjis authored Mar 18, 2023
2 parents 7cb1e49 + 6413513 commit 062d66b
Show file tree
Hide file tree
Showing 23 changed files with 299 additions and 36 deletions.
3 changes: 3 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ changelog:
- title: Enhancements
labels:
- enhancement
- title: Translations
labels:
- lang
- title: Refactoring
labels:
- refactor
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: docs
name: docs
on:
push:
branches:
- master
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -11,5 +13,5 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install mkdocs-material
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
12 changes: 5 additions & 7 deletions docs/forcing_password_reset.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Depending on the scope of your application, there may be times when you'll decid
- [Available Methods](#available-methods)
- [Check if a User Requires Password Reset](#check-if-a-user-requires-password-reset)
- [Force Password Reset On a User](#force-password-reset-on-a-user)
- [Removing Password Reset Flag On a User](#removing-password-reset-flag-on-a-user)
- [Remove Force Password Reset Flag On a User](#remove-force-password-reset-flag-on-a-user)
- [Force Password Reset On Multiple Users](#force-password-reset-on-multiple-users)
- [Force Password Reset On All Users](#force-password-reset-on-all-users)

Expand Down Expand Up @@ -46,9 +46,8 @@ If you see the need to force password reset for more than one user, the `forceMu

```php
use CodeIgniter\Shield\Models\UserIdentityModel;
...
...
...

// ...
$identities = new UserIdentityModel();
$identities->forceMultiplePasswordReset([1,2,3,4]);
```
Expand All @@ -59,9 +58,8 @@ If you suspect a security breach or compromise in the passwords of your users, y

```php
use CodeIgniter\Shield\Models\UserIdentityModel;
...
...
...

// ...
$identities = new UserIdentityModel();
$identities->forceGlobalPasswordReset();
```
6 changes: 3 additions & 3 deletions docs/guides/strengthen_password.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ and `$hashThreads`.
If you use `PASSWORD_ARGON2ID`, you should use PHP's constants:

```php
public int $hashMemoryCost = PASSWORD_ARGON2_DEFAULT_MEMORY_COST;
public int $hashMemoryCost = PASSWORD_ARGON2_DEFAULT_MEMORY_COST;

public int $hashTimeCost = PASSWORD_ARGON2_DEFAULT_TIME_COST;
public int $hashThreads = PASSWORD_ARGON2_DEFAULT_THREADS;
public int $hashTimeCost = PASSWORD_ARGON2_DEFAULT_TIME_COST;
public int $hashThreads = PASSWORD_ARGON2_DEFAULT_THREADS;
```

## Maximum Password Length
Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* [Authentication](authentication.md)
* [Authorization](authorization.md)
* [Auth Actions](auth_actions.md)
* [Forcing Password Reset](forcing_password_reset.md)
* [Events](events.md)
* [Testing](testing.md)
* [Customization](customization.md)
* [Forcing Password Reset](forcing_password_reset.md)
* [Banning Users](banning_users.md)

## Guides
* [Protecting an API with Access Tokens](guides/api_tokens.md)
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ nav:
- Events: events.md
- Testing: testing.md
- Customization: customization.md
- Forcing Password Reset: forcing_password_reset.md
- Banning Users: banning_users.md
- session_auth_event_and_logging.md
- Guides:
- guides/api_tokens.md
Expand Down
5 changes: 5 additions & 0 deletions src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
*/
class Auth
{
/**
* The current version of CodeIgniter Shield
*/
public const SHIELD_VERSION = '1.0.0-beta.5';

protected Authentication $authenticate;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Collectors/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct()
*/
public function getTitleDetails(): string
{
return get_class($this->auth->getAuthenticator());
return ShieldAuth::SHIELD_VERSION . ' | ' . get_class($this->auth->getAuthenticator());
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Commands/Generators/Views/usermodel.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class {class} extends ShieldUserModel
{
protected function initialize(): void
{
parent::initialize();

$this->allowedFields = [
...$this->allowedFields,

Expand Down
6 changes: 3 additions & 3 deletions src/Language/de/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
'unknownAuthenticator' => '{0} ist kein gültiger Authentifikator.',
'unknownUserProvider' => 'Der zu verwendende User Provider konnte nicht ermittelt werden.',
'invalidUser' => 'Der angegebene Benutzer kann nicht gefunden werden.',
'bannedUser' => '(To be translated) Can not log you in as you are currently banned.',
'logOutBannedUser' => '(To be translated) You have been logged out because you have been banned.',
'bannedUser' => 'Anmelden nicht möglich da Ihr Benutzer derzeit gesperrt ist.',
'logOutBannedUser' => 'Ihr Benutzer wurde abgemeldet und gesperrt.',
'badAttempt' => 'Sie konnten nicht angemeldet werden. Bitte überprüfen Sie Ihre Anmeldedaten.',
'noPassword' => 'Kann einen Benutzer ohne Passwort nicht validieren.',
'invalidPassword' => 'Sie können nicht angemeldet werden. Bitte überprüfen Sie Ihr Passwort.',
Expand Down Expand Up @@ -61,7 +61,7 @@
'errorPasswordPwned' => 'Das Passwort {0} wurde aufgrund einer Datenschutzverletzung aufgedeckt und wurde {1, number} Mal in {2} kompromittierten Passwörtern gesehen.',
'suggestPasswordPwned' => '{0} sollte niemals als Passwort verwendet werden. Wenn Sie es irgendwo verwenden, ändern Sie es sofort.',
'errorPasswordEmpty' => 'Ein Passwort ist erforderlich.',
'errorPasswordTooLongBytes' => '(To be translated) Password cannot exceed {param} bytes in length.',
'errorPasswordTooLongBytes' => 'Das Passwort darf die Länge von {param} Bytes nicht überschreiten.',
'passwordChangeSuccess' => 'Passwort erfolgreich geändert',
'userDoesNotExist' => 'Passwort wurde nicht geändert. Der Benutzer existiert nicht',
'resetTokenExpired' => 'Tut mir leid. Ihr Reset-Token ist abgelaufen.',
Expand Down
2 changes: 1 addition & 1 deletion src/Language/fa/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
'errorPasswordPwned' => 'رمز عبور {0} با توجه به نقض داده ها و دیده شدن {1, number} بارها داخل رمز های عبور {2} به پسورد های ناامن تبدیل شده و در معرض قرار گرفته است.',
'suggestPasswordPwned' => '{0} هرگز نباید به عنوان رمز عبور استفاده شود. اگر در هر جایی از آن استفاده می کنید سریعا آن را تغییر دهید.',
'errorPasswordEmpty' => 'رمز عبور الزامی است.',
'errorPasswordTooLongBytes' => '(To be translated) Password cannot exceed {param} bytes in length.',
'errorPasswordTooLongBytes' => 'طول رمز عبور نمی تواند از {param} بایت بیشتر باشد.',
'passwordChangeSuccess' => 'رمز عبور با موفقیت تغییر کرد',
'userDoesNotExist' => 'رمز عبور تغییر نکرد. کاربر وجود ندارد.',
'resetTokenExpired' => 'متاسفانه، توکن بازنشانی شما منقضی شده است.',
Expand Down
8 changes: 4 additions & 4 deletions src/Language/fr/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
'unknownAuthenticator' => '{0} n\'est pas un authentificateur valide.',
'unknownUserProvider' => 'Impossible de déterminer le User Provider à utiliser.',
'invalidUser' => 'Impossible de trouver l\'utilisateur.',
'bannedUser' => '(To be translated) Can not log you in as you are currently banned.',
'logOutBannedUser' => '(To be translated) You have been logged out because you have been banned.',
'bannedUser' => 'Impossible de vous connecter car vous êtes actuellement banni.',
'logOutBannedUser' => 'Vous avez été déconnecté car vous avez été banni.',
'badAttempt' => 'Connexion impossible. Veuillez vérifier les informations saisies.',
'noPassword' => 'Impossible de valider un utilisateur sans mot de passe.',
'invalidPassword' => 'Connexion impossible. Veuillez vérifier votre mot de passe.',
Expand Down Expand Up @@ -61,7 +61,7 @@
'errorPasswordPwned' => 'Le mot de passe {0} a été exposé à la suite d\'une violation de données et a été vu {1, number} fois dans {2} des mots de passe compromis.',
'suggestPasswordPwned' => '{0} ne devrait jamais être utilisé comme mot de passe. Si vous l\'utilisez quelque part, changez-le immédiatement.',
'errorPasswordEmpty' => 'Un mot de passe est obligatoire.',
'errorPasswordTooLongBytes' => '(To be translated) Password cannot exceed {param} bytes in length.',
'errorPasswordTooLongBytes' => 'Le mot de passe ne doit pas dépasser {param} octets de longueur.',
'passwordChangeSuccess' => 'Mot de passe modifié avec succès',
'userDoesNotExist' => 'Le mot de passe n\'a pas été modifié. L\'utilisateur n\'existe pas',
'resetTokenExpired' => 'Désolé. Votre jeton de réinitialisation a expiré.',
Expand Down Expand Up @@ -90,7 +90,7 @@
'emailActivateMailBody' => 'Veuillez utiliser le code suivant pour activer votre compte et commencer à utiliser le site.',
'invalidActivateToken' => 'Le code était incorrect.',
'needActivate' => 'Complétez votre inscription en confirmant le code envoyé à votre email.',
'activationBlocked' => '(to be translated) You must activate your account before logging in.',
'activationBlocked' => 'Vous devez activer votre compte avant de vous connecter.',

// Groups
'unknownGroup' => '{0} n\'est pas un groupe valide.',
Expand Down
2 changes: 1 addition & 1 deletion src/Language/ja/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
'errorPasswordPwned' => 'パスワード {0} はデータ漏洩により公開されており、{2} の漏洩したパスワード中で {1, number} 回見られます。', // 'The password {0} has been exposed due to a data breach and has been seen {1, number} times in {2} of compromised passwords.',
'suggestPasswordPwned' => '{0} は絶対にパスワードとして使ってはいけません。もしどこかで使っていたら、すぐに変更してください。', // '{0} should never be used as a password. If you are using it anywhere change it immediately.',
'errorPasswordEmpty' => 'パスワードが必要です。', // 'A Password is required.',
'errorPasswordTooLongBytes' => '(To be translated) Password cannot exceed {param} bytes in length.',
'errorPasswordTooLongBytes' => '{param} バイトを超えるパスワードは設定できません。', // 'Password cannot exceed {param} bytes in length.',
'passwordChangeSuccess' => 'パスワードの変更に成功しました', // 'Password changed successfully',
'userDoesNotExist' => 'パスワードは変更されていません。ユーザーは存在しません', // 'Password was not changed. User does not exist',
'resetTokenExpired' => '申し訳ありません。リセットトークンの有効期限が切れました。', // 'Sorry. Your reset token has expired.',
Expand Down
8 changes: 4 additions & 4 deletions src/Language/pt-BR/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
'unknownAuthenticator' => '{0} não é um autenticador válido.',
'unknownUserProvider' => 'Não foi possível determinar o provedor de usuário a ser usado.',
'invalidUser' => 'Não foi possível localizar o usuário especificado.',
'bannedUser' => '(To be translated) Can not log you in as you are currently banned.',
'logOutBannedUser' => '(To be translated) You have been logged out because you have been banned.',
'bannedUser' => 'Não é possível fazer login porque você está banido no momento.',
'logOutBannedUser' => 'Você foi desconectado porque foi banido.',
'badAttempt' => 'Não foi possível fazer login. Por favor, verifique suas credenciais.',
'noPassword' => 'Não é possível validar um usuário sem uma senha.',
'invalidPassword' => 'Não foi possível fazer login. Por favor, verifique sua senha.',
Expand Down Expand Up @@ -61,7 +61,7 @@
'errorPasswordPwned' => 'A senha {0} foi exposta devido a uma violação de dados e foi vista {1, number} vezes em {2} de senhas comprometidas.',
'suggestPasswordPwned' => '{0} nunca deve ser usado como uma senha. Se você estiver usando em algum lugar, altere imediatamente.',
'errorPasswordEmpty' => 'É necessária uma senha.',
'errorPasswordTooLongBytes' => '(To be translated) Password cannot exceed {param} bytes in length.',
'errorPasswordTooLongBytes' => 'A senha não pode exceder {param} bytes.',
'passwordChangeSuccess' => 'Senha alterada com sucesso',
'userDoesNotExist' => 'Senha não foi alterada. Usuário não existe',
'resetTokenExpired' => 'Desculpe. Seu token de redefinição expirou.',
Expand Down Expand Up @@ -90,7 +90,7 @@
'emailActivateMailBody' => 'Use o código abaixo para ativar sua conta e começar a usar o site.',
'invalidActivateToken' => 'O código estava incorreto.',
'needActivate' => 'Você deve concluir seu registro confirmando o código enviado para seu endereço de e-mail.',
'activationBlocked' => '(to be translated) You must activate your account before logging in.',
'activationBlocked' => 'Você deve ativar sua conta antes de fazer o login.',

// Grupos
'unknownGroup' => '{0} não é um grupo válido.',
Expand Down
8 changes: 4 additions & 4 deletions src/Language/sk/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
'unknownAuthenticator' => '{0} nie je platný autentifikátor.',
'unknownUserProvider' => 'Nie je možné určiť poskytovateľa používateľa, ktorý sa má použiť.',
'invalidUser' => 'Nie je možné nájsť zadaného používateľa.',
'bannedUser' => '(To be translated) Can not log you in as you are currently banned.',
'logOutBannedUser' => '(To be translated) You have been logged out because you have been banned.',
'bannedUser' => 'Prihlásenie zlyhalo, pretože ste dostali zákaz vstupu (ban).',
'logOutBannedUser' => 'Boli ste odhlásení, pretože ste dostali zákaz vstupu (ban).',
'badAttempt' => 'Prihlásenie zlyhalo. Skontrolujte svoje prihlasovacie údaje.',
'noPassword' => 'Nie je možné overiť používateľa bez hesla.',
'invalidPassword' => 'Prihlásenie zlyhalo. Skontrolujte svoje heslo.',
Expand Down Expand Up @@ -61,7 +61,7 @@
'errorPasswordPwned' => 'Heslo {0} bolo odhalené z dôvodu porušenia ochrany údajov a bolo videné {1, number}-krát z {2} prelomených hesiel.',
'suggestPasswordPwned' => '{0} by sa nikdy nemalo používať ako heslo. Ak ho niekde používate, okamžite ho zmeňte.',
'errorPasswordEmpty' => 'Vyžaduje sa heslo.',
'errorPasswordTooLongBytes' => '(To be translated) Password cannot exceed {param} bytes in length.',
'errorPasswordTooLongBytes' => 'Heslo nemôže presiahnuť dĺžku {param} bajtov',
'passwordChangeSuccess' => 'Heslo bolo úspešne zmenené',
'userDoesNotExist' => 'Heslo nebolo zmenené. Používateľ neexistuje',
'resetTokenExpired' => 'Prepáčte. Platnosť vášho resetovacieho tokenu vypršala.',
Expand Down Expand Up @@ -90,7 +90,7 @@
'emailActivateMailBody' => 'Pomocou nižšie uvedeného kódu aktivujte svoj účet a môžete začať používať stránku.',
'invalidActivateToken' => 'Kód bol nesprávny',
'needActivate' => 'Registráciu musíte dokončiť potvrdením kódu zaslaného na vašu e-mailovú adresu.',
'activationBlocked' => '(to be translated) You must activate your account before logging in.',
'activationBlocked' => 'Pred prihlásením si musíte aktivovať svoj účet.',

// Groups
'unknownGroup' => '{0} nie je platná skupina.',
Expand Down
Loading

0 comments on commit 062d66b

Please sign in to comment.