-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from GoteoFoundation/feat/user_info_endpoint
FEAT: Update /userInfo endpoint
- Loading branch information
Showing
21 changed files
with
1,596 additions
and
1,327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,17 @@ | ||
league_oauth2_server: | ||
authorization_server: # Required | ||
|
||
# Full path to the private key file. | ||
# How to generate a private key: https://oauth2.thephpleague.com/installation/#generating-public-and-private-keys | ||
private_key: '%env(OAUTH2_PRIVATE_KEY_PATH)%' # Required, Example: /var/oauth/private.key | ||
|
||
# Passphrase of the private key, if any | ||
private_key_passphrase: null | ||
|
||
# The plain string or the ascii safe string used to create a Defuse\Crypto\Key to be used as an encryption key. | ||
# How to generate an encryption key: https://oauth2.thephpleague.com/installation/#string-password | ||
encryption_key: '%env(OAUTH2_ENCRYPTION_KEY)%' # Required | ||
|
||
# The type of value of 'encryption_key' | ||
encryption_key_type: plain # One of "plain"; "defuse" | ||
|
||
# How long the issued access token should be valid for. | ||
# The value should be a valid interval: http://php.net/manual/en/dateinterval.construct.php#refsect1-dateinterval.construct-parameters | ||
access_token_ttl: PT1H | ||
|
||
# How long the issued refresh token should be valid for. | ||
# The value should be a valid interval: http://php.net/manual/en/dateinterval.construct.php#refsect1-dateinterval.construct-parameters | ||
refresh_token_ttl: P1M | ||
|
||
# How long the issued auth code should be valid for. | ||
# The value should be a valid interval: http://php.net/manual/en/dateinterval.construct.php#refsect1-dateinterval.construct-parameters | ||
auth_code_ttl: PT10M | ||
|
||
# Whether to enable the client credentials grant | ||
enable_client_credentials_grant: true | ||
|
||
# Whether to enable the password grant | ||
enable_password_grant: true | ||
|
||
# Whether to enable the refresh token grant | ||
enable_refresh_token_grant: true | ||
|
||
# Whether to enable the authorization code grant | ||
enable_auth_code_grant: true | ||
|
||
# Whether to require code challenge for public clients for the auth code grant | ||
require_code_challenge_for_public_clients: true | ||
|
||
# Whether to enable access token saving to persistence layer (default to true) | ||
persist_access_token: true | ||
|
||
resource_server: # Required | ||
|
||
# Full path to the public key file | ||
# How to generate a public key: https://oauth2.thephpleague.com/installation/#generating-public-and-private-keys | ||
public_key: '%env(OAUTH2_PUBLIC_KEY_PATH)%' # Required, Example: /var/oauth/public.key | ||
|
||
scopes: | ||
# Scopes that you wish to utilize in your application. | ||
# This should be a simple array of strings. | ||
available: [TEST] | ||
|
||
# Scopes that will be assigned when no scope given. | ||
# This should be a simple array of strings. | ||
default: [TEST] | ||
|
||
# Configures different persistence methods that can be used by the bundle for saving client and token data. | ||
# Only one persistence method can be configured at a time. | ||
persistence: # Required | ||
doctrine: | ||
# Name of the entity manager that you wish to use for managing clients and tokens. | ||
entity_manager: default | ||
# in_memory: ~ | ||
|
||
# Set a custom prefix that replaces the default 'ROLE_OAUTH2_' role prefix | ||
role_prefix: ROLE_OAUTH2_ | ||
|
||
client: | ||
# Set a custom client class. Must be a League\Bundle\OAuth2ServerBundle\Model\Client | ||
classname: League\Bundle\OAuth2ServerBundle\Model\Client | ||
authorization_server: | ||
private_key: '%env(resolve:OAUTH_PRIVATE_KEY)%' | ||
private_key_passphrase: '%env(resolve:OAUTH_PASSPHRASE)%' | ||
encryption_key: '%env(resolve:OAUTH_ENCRYPTION_KEY)%' | ||
resource_server: | ||
public_key: '%env(resolve:OAUTH_PUBLIC_KEY)%' | ||
scopes: | ||
available: ['email'] | ||
default: ['email'] | ||
persistence: | ||
doctrine: null | ||
|
||
when@test: | ||
league_oauth2_server: | ||
persistence: | ||
in_memory: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
oauth2_server: | ||
resource: '@LeagueOAuth2ServerBundle/Resources/config/routes.php' | ||
type: php |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
|
||
namespace App\Entity; | ||
|
||
use App\Repository\InvestRepository; | ||
use Doctrine\DBAL\Types\Types; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
#[ORM\Entity(repositoryClass: InvestRepository::class)] | ||
class Invest | ||
{ | ||
#[ORM\Id] | ||
#[ORM\GeneratedValue] | ||
#[ORM\Column] | ||
private ?int $id = null; | ||
|
||
#[ORM\Column(name: 'user', type: 'string', length: 50)] | ||
private ?string $userId = null; | ||
|
||
#[ORM\Column] | ||
private ?int $amount = null; | ||
|
||
#[ORM\Column] | ||
private ?int $status = null; | ||
|
||
#[ORM\Column(type: Types::DATE_MUTABLE)] | ||
private ?\DateTimeInterface $invested = null; | ||
|
||
public function getId(): ?int | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function getUserId(): ?string | ||
{ | ||
return $this->userId; | ||
} | ||
|
||
public function setUserId(?string $userId): static | ||
{ | ||
$this->userId = $userId; | ||
|
||
return $this; | ||
} | ||
|
||
public function getAmount(): ?int | ||
{ | ||
return $this->amount; | ||
} | ||
|
||
public function setAmount(int $amount): static | ||
{ | ||
$this->amount = $amount; | ||
|
||
return $this; | ||
} | ||
|
||
public function getStatus(): ?int | ||
{ | ||
return $this->status; | ||
} | ||
|
||
public function setStatus(int $status): static | ||
{ | ||
$this->status = $status; | ||
|
||
return $this; | ||
} | ||
|
||
public function getInvested(): ?\DateTimeInterface | ||
{ | ||
return $this->invested; | ||
} | ||
|
||
public function setInvested(\DateTimeInterface $invested): static | ||
{ | ||
$this->invested = $invested; | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace App\Entity; | ||
|
||
use App\Repository\InvestRewardRepository; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
#[ORM\Entity(repositoryClass: InvestRewardRepository::class)] | ||
class InvestReward | ||
{ | ||
#[ORM\Id] | ||
#[ORM\GeneratedValue] | ||
#[ORM\Column] | ||
private ?int $id = null; | ||
|
||
#[ORM\Column()] | ||
private ?int $invest = null; | ||
|
||
#[ORM\Column()] | ||
private ?int $reward = null; | ||
|
||
public function getId(): ?int | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function getInvest(): ?int | ||
{ | ||
return $this->invest; | ||
} | ||
|
||
public function setInvest(int $invest): static | ||
{ | ||
$this->invest = $invest; | ||
|
||
return $this; | ||
} | ||
|
||
public function getReward(): ?int | ||
{ | ||
return $this->reward; | ||
} | ||
|
||
public function setReward(int $reward): static | ||
{ | ||
$this->reward = $reward; | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.