Skip to content

Commit ede8385

Browse files
committed
part3
1 parent 38363aa commit ede8385

File tree

14 files changed

+100
-3029
lines changed

14 files changed

+100
-3029
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
/vendor/
1010
/bin/
1111
/composer.phar
12+
/composer.lock

app/config/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ fos_rest:
9494
access_denied_listener:
9595
json: true
9696
body_listener: true
97+
disable_csrf_role: ROLE_API
98+
9799

98100
nelmio_api_doc:
99101
name: Page API

app/config/security.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ security:
1010
in_memory:
1111
memory:
1212
users:
13-
user: { password: userpass, roles: [ 'ROLE_USER' ] }
14-
admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
13+
user: { password: userpass, roles: [ 'ROLE_USER', 'ROLE_API' ] }
14+
admin: { password: adminpass, roles: [ 'ROLE_ADMIN', 'ROLE_API' ] }
1515

1616
firewalls:
1717
dev:
@@ -23,17 +23,7 @@ security:
2323
security: false
2424

2525
secured_area:
26-
pattern: ^/demo/secured/
27-
form_login:
28-
check_path: _security_check
29-
login_path: _demo_login
30-
logout:
31-
path: _demo_logout
32-
target: _demo
33-
#anonymous: ~
34-
#http_basic:
35-
# realm: "Secured Demo Area"
36-
37-
access_control:
38-
- { path: ^/demo/secured/hello/admin/, roles: ROLE_ADMIN }
39-
#- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
26+
pattern: ^/api
27+
anonymous: ~
28+
http_basic:
29+
realm: "You should have a user name and password"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"sensio/framework-extra-bundle": "2.3.*",
2020
"sensio/generator-bundle": "2.3.*",
2121
"incenteev/composer-parameter-handler": "~2.0",
22-
"friendsofsymfony/rest-bundle": "@dev",
22+
"friendsofsymfony/rest-bundle": "~1.1",
2323
"jms/serializer-bundle": "@dev",
2424
"willdurand/rest-extra-bundle": "@dev",
2525
"nelmio/api-doc-bundle": "@dev"

0 commit comments

Comments
 (0)