Skip to content

Commit

Permalink
[+] pagination
Browse files Browse the repository at this point in the history
[+] API Security
[+] Manual API
[+] SearchForm.
  • Loading branch information
pyatnitsev committed Nov 28, 2023
1 parent 8ec539e commit 8a91efe
Show file tree
Hide file tree
Showing 20 changed files with 587 additions and 14 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"babdev/pagerfanta-bundle": "^4.2",
"doctrine/doctrine-bundle": "^2.10",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/orm": "^2.16",
"pagerfanta/doctrine-orm-adapter": "^4.2",
"pagerfanta/twig": "^4.2",
"phpdocumentor/reflection-docblock": "^5.3",
"phpstan/phpdoc-parser": "^1.24",
"symfony/asset": "6.3.*",
Expand Down
223 changes: 222 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
];
3 changes: 3 additions & 0 deletions config/packages/babdev_pagerfanta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
babdev_pagerfanta:
# The default Pagerfanta view to use in your application
default_view: twitter_bootstrap5
11 changes: 10 additions & 1 deletion config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@ security:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
api:
pattern: ^/api
lazy: true
provider: app_user_provider
custom_authenticators:
- App\Security\ApiKeyAuthenticator
main:
lazy: true
provider: app_user_provider
custom_authenticator: App\Security\AppCustomAuthenticator
custom_authenticators:
- App\Security\AppCustomAuthenticator
- App\Security\ApiKeyAuthenticator
logout:
path: app_logout
# where to redirect after logout
Expand All @@ -38,6 +46,7 @@ security:
# Note: Only the *first* access control that matches will be used
access_control:
- { path: ^/profile, roles: ROLE_USER }
- { path: ^/api, roles: ROLE_USER }
- { path: ^/admin, roles: ROLE_ADMIN }
- { path: ^/, roles: PUBLIC_ACCESS }

Expand Down
31 changes: 31 additions & 0 deletions migrations/Version20231128043516.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20231128043516 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user ADD api_key VARCHAR(255) DEFAULT NULL');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE `user` DROP api_key');
}
}
Loading

0 comments on commit 8a91efe

Please sign in to comment.