Accueil
Partager c'est Aimer
Depuis 2 jours maintenant, j'ai débuter la création d'un nouvel API PHP nommé phpAPI. Cette API a pour but d'être simple à utiliser et facile à intégrer dans vos projet. J'ai débuter avec la base. C'est a dire le traitement des demandes.
Toutefois je me rend compte que je devrais sans doute extraire la Class Database afin de la publier séparement.
Aujourd'hui j'ai commencé le travail d'une class Auth pour gérer l'authentification et les authorizations. J'ai déjà couvert le nécessaire dans la bootstrap.php de l'API. Et j'ai aussi créer quelque méthode pour recueillir les informations d'authentification. Présentement j'ai ajouter le support pour l'authentification de type BASIC et BEARER. OAuth et API Key sont à venir.
Toutefois, je tourne mes réflexions sur les authorizations. Idéalement j'aimerais ajouter le support de Rôles, Permissions, Groupes et Utilisateurs. Mais en même temps, je ne veux pas forcer une structure de base de donnée aux utilisateurs de l'API. De plus, il ne faut pas trop multiplier les requêtes SQL pour établir l'authorization de l'utilisateur. Par conséquent, comment s'y prendre.
Pour l'instant, voici la structure dont j'ai penser utiliser:
Tableau: users | ||
---|---|---|
Nom | Type | Extra |
id | bigint(20) | AUTO_INCREMENT |
username | varchar(100) | UNIQUE |
password | varchar(100) | |
status | int(1) | |
token | varchar(100) |
Plein la tête
Me voila encore sur une nouvelle quête. Quoi que j'ai rencontrer Composer / Packagist dans le passé, je me lance aujourd'hui dans l'étude de cette outil open source. Ce qui m'a attirer vers cette outils est sa capacité a étendre les fonctionnalités de projet existant. Après quelques tentatives, j'ai réussi a maitrisé les commandes de base. Soit la création d'un package pour packagist et l'installation d'un autre projet dans un projet existant. Cet outil s'integre bien a GitHub. Sufit de le connecté. Puis créer un release. Par la suite on soumet le projet GitHub sur Packagist.
J'ai pensé utilisé cette outil afin de publier les multiples bibliothèques PHP que j'ai écrit depuis. Ceci me permettra alors de mieux les intégrer ensemble dans un plus gros projet tel que coreDB.
Aujourd'hui j'ai commencer par publier 2 bibliothèques. phpIMAP et phpSMTP.
phpIMAP est une class PHP permettant d'authentifier un utilisateur et de gérer une boîte courriel IMAP. J'ai initialement écrit cette class afin de lire des courriels et de repérer des informations spécifique dans ceux-ci. Ainsi lors du formatage des courriels, le sujet et tous les combinaisons de caractères sont lu afin de repérer des numéros de référence. De plus, des numéros de références peuvent être prédéfini en utilisant le formatage suivant: [type:référence]
.
phpSMTP est une class PHP ajoutant des fonctionnalités a PHPMailer. Celle-ci permet d'authentifier un utilisateur sur un serveur d'envoi SMTP. De plus, des fonctionnalités de modèles y sont ajoutés. Permettant ainsi de faciliter la création de courriel.
[BROUILLON] Installation de Raspberry Pi OS Sans-Tête
Dans ce tutoriel, vous apprendrez comment installer Raspberry Pi OS sans clavier, souris et moniteur.
Version 22.04-dev Build: 121
- (README.md): Updated the readme file to match the license
Version 22.04-dev Build: 120
- (LICENSE): Change license to GNU GPLv3
- (TASKS.md): Updated Tasks list
- (dist/css/stylesheet.css): Added support for various bootstrap switches sizes
- (dist/js/engine.js): Increased the size of the profile status button
- (dist/js/engine.js): Added a notification tab to the profile so the user can control his notifications
- (dist/js/engine.js): Fixed some responsive issues with the details layout
- (dist/js/engine.js): Added a component switch to forms
- (dist/js/engine.js): Added shadows to timeline
- (src/lib/api.php): Fixed an issue with the init method of Helper that would not accept multiple parameters at once. Meaning a single plugin could not create multiple notification types for exemple.
- (src/lib/notification.php): Change the notification type SQL to Application. This is meant so that users will better understand the type of notifications
Version 22.04-dev Build: 119
- (TASKS.md): Updated the tasks list
- (dist/css/stylesheet.css): Fixed an issue where the background would appear above the application layout
- (dist/js/engine.js): Fixed an issue where if the api options array came out as null, it would break the init function.
- (dist/js/engine.js): Changed the debug logo to a rotating cog
- (dist/js/engine.js): Fixed an issue with crud forms where the last input would not considerate if it should take full width correctly
- (dist/js/engine.js): Added noselect to sidebar to prevent any text selection
- (dist/js/engine.js): Added support for notification subject and body
- (dist/languages/english.json): Added new fields
- (src/lib/api.php): Added helpers and support for plugins
- (src/lib/api.php): The Helper→init() function will now be executed and used to expand the API configurations
- (src/lib/api.php): All user data are now loaded within Auth
- (src/lib/api.php): Fixed an issue where if no language settings exist, system language would not be setup
- (src/lib/auth.php): All user data are now loaded within Auth
- (src/lib/helper.php): Helper now loads all plugin's helper within a Helpers property
- (src/lib/helper.php): A new method scan() has been added
- (src/lib/helper.php): A new method init() has been added
- (src/lib/helper.php): A new method plugins() has been added
- (src/lib/helper.php): A new method loadHelpers() has been added
- (src/lib/helper.php): A new method exist() has been added
- (src/lib/notification.php): New notification types are now supported and can be added through a helper init function
- (src/lib/notification.php): Added support for email notifications
- (src/lib/notification.php): Added settings to notifications to control which notifications to create and/or send
- (src/templates/template.php): Added support for plugins for stylesheets and javascripts extansions
Version 22.04-dev Build: 118
- (TASKS.md): Updated the tasks list
- (dist/js/engine.js): Changed the color of the debug icon to primary
- (dist/js/engine.js): Fixed an issue with forms components where the name attribute would be set to all lowerCase
- (dist/js/engine.js): Added an option to all forms components to hide the input. This will create the html and add the class d-none to the main container
- (dist/js/engine.js): Completed the table control new. The control now generates a form to create a new record based on the table. A predifined form can also be set to the table.
- (dist/js/engine.js): Completed the table action edit. The action now generates a form to edit a record in the table. Again based on the table. A predefined form can also be set to the table for the update form.
- (dist/js/engine.js): Completed the table action delete. This action deletes a record from the table and database.
- (dist/js/engine.js): Added support for custom forms in the table.
- (dist/js/engine.js): The row.data() function now also allow you to update the data of the row.
- (dist/js/engine.js): Fixed an issue where adding a row based on a record that did not have the same keys order would create a row with the bad key order.
- (dist/js/engine.js): Form header translation can now be toggled
- (dist/js/engine.js): The basic CRUD pages have now been updated using the new list method of the CRUD api.
- (src/lib/api.php): Added Helpers to the api. The helpers can be used to extends some existing methods.
- (src/lib/crud.php): A new list method has been added to fetch all the necessary information for a table listing in one request.
- (src/lib/database.php): Fixed an issue in the prepare method where a DELETE type would not automatically add the primary key condition.
- (src/lib/installer.php): Added a group administrator to each new group created during install.
Version 22.04-dev Build: 117
- (TASKS.md): Updated the task list
- (dist/js/engine.js): Added shadows to table cards
- (dist/js/engine.js): Added a loader to tables
- (dist/js/engine.js): Added a cursor pointer to the debug button
- (dist/js/engine.js): Fixed an issue where the listing layout would not provide the entire table functions
- (dist/js/engine.js): Added an empty notice to listings