Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/.name

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

18 changes: 18 additions & 0 deletions .idea/ManAgileAPI.iml

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

14 changes: 14 additions & 0 deletions .idea/misc.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

594 changes: 594 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function registerBundles()
new ApiBundle\ApiBundle(),
new FOS\UserBundle\FOSUserBundle(),
new FOS\RestBundle\FOSRestBundle(),
new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
);

Expand Down
22 changes: 16 additions & 6 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ framework:
fragments: ~
http_method_override: true

# Twig Configuration
# Twig
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"

# Assetic Configuration
# Assetic
assetic:
debug: "%kernel.debug%"
use_controller: false
Expand All @@ -49,7 +49,7 @@ assetic:
#yui_css:
# jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"

# Doctrine Configuration
# Doctrine
doctrine:
dbal:
driver: pdo_mysql
Expand All @@ -71,21 +71,21 @@ doctrine:
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true

# Swiftmailer Configuration
# Swiftmailer
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }

# FOSUserBundle Configuration
# FOSUserBundle
fos_user:
db_driver: orm
firewall_name: main
user_class: ApiBundle\Entity\FosUser

# FOSRestBundle Configuration
# FOSRestBundle
fos_rest:
param_fetcher_listener: true
body_listener: true
Expand All @@ -103,3 +103,13 @@ fos_rest:
default_engine: twig
routing_loader:
default_format: json

# FOSOauthBundle
fos_oauth_server:
db_driver: orm # Driver availables: orm, mongodb, or propel
client_class: ApiBundle\Entity\Client
access_token_class: ApiBundle\Entity\AccessToken
refresh_token_class: ApiBundle\Entity\RefreshToken
auth_code_class: ApiBundle\Entity\AuthCode
service:
user_provider: fos_user.user_manager
9 changes: 9 additions & 0 deletions app/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ rest :
type : rest
resource : "routing_rest.yml"
prefix : /api

api.oauth:
resource: "@ApiBundle/Resources/config/routing.yml"

fos_oauth_server_token:
resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"

fos_oauth_server_authorize:
resource: "@FOSOAuthServerBundle/Resources/config/routing/authorize.xml"
16 changes: 16 additions & 0 deletions app/config/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ security:
id: fos_user.user_provider.username

firewalls:
oauth_authorize:
pattern: ^/oauth/v2/auth
form_login:
provider: fos_userbundle
check_path: /oauth/v2/auth_login_check
login_path: /oauth/v2/auth_login
anonymous: true
oauth_token:
pattern: ^/oauth/v2/token
security: false
api:
pattern: ^/api
fos_oauth: true
stateless: true
anonymous: false # can be omitted as its default value
main:
pattern: ^/
form_login:
Expand All @@ -23,6 +38,7 @@ security:
anonymous: true

access_control:
- { path: ^/api, roles: IS_AUTHENTICATED_FULLY }
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"friendsofsymfony/user-bundle": "~2.0@dev",
"friendsofsymfony/rest-bundle": "^1.7",
"jms/serializer-bundle": "^1.0",
"twig/twig": "~1.0"
"twig/twig": "~1.0",
"friendsofsymfony/oauth-server-bundle": "dev-master"
},
"require-dev": {
"sensio/generator-bundle": "~2.3"
Expand Down
130 changes: 127 additions & 3 deletions composer.lock

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

Loading