From 23bfcb65dbddc39f4eec0c49a1a80e4dbc15c648 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Tue, 10 Mar 2026 20:32:04 -0500 Subject: [PATCH] testing --- .../Controllers/Auth/EveLoginController.php | 1 + app/Http/Middleware/RefreshUserJwt.php | 5 + app/Http/Middleware/RequirePermission.php | 2 - app/Http/Middleware/RequireRole.php | 3 +- app/Http/Middleware/ValidateJwt.php | 6 + app/Library/Login/LoginHelper.php | 330 ------- app/Library/Moons/MoonCalc.php | 626 ------------ ...esService.php => UserPrivilegeService.php} | 0 composer.json | 1 + composer.lock | 898 +++++++++++++++++- 10 files changed, 911 insertions(+), 961 deletions(-) delete mode 100644 app/Library/Login/LoginHelper.php delete mode 100644 app/Library/Moons/MoonCalc.php rename app/Services/{UserPrivilegesService.php => UserPrivilegeService.php} (100%) diff --git a/app/Http/Controllers/Auth/EveLoginController.php b/app/Http/Controllers/Auth/EveLoginController.php index 1f46f85..3175ce2 100644 --- a/app/Http/Controllers/Auth/EveLoginController.php +++ b/app/Http/Controllers/Auth/EveLoginController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Auth; //Library use App\Http\Controllers\Controller; use App\Services\JwtService; +use App\Services\UserPrivilegeService; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; diff --git a/app/Http/Middleware/RefreshUserJwt.php b/app/Http/Middleware/RefreshUserJwt.php index 64ad9a5..15fbf2c 100644 --- a/app/Http/Middleware/RefreshUserJwt.php +++ b/app/Http/Middleware/RefreshUserJwt.php @@ -11,6 +11,11 @@ class RefreshUserJwt { protected JwtService $jwtService; + /** + * Handle an incoming request. + * + * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next + */ public function __construct(JwtService $jwtService) { $this->jwtService = $jwtService; diff --git a/app/Http/Middleware/RequirePermission.php b/app/Http/Middleware/RequirePermission.php index 425d8dd..c509335 100644 --- a/app/Http/Middleware/RequirePermission.php +++ b/app/Http/Middleware/RequirePermission.php @@ -18,8 +18,6 @@ class RequirePermission * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next - * @param \Closure $next - * @return mixed */ public function handle(Request $request, Closure $next, $permission): Response { diff --git a/app/Http/Middleware/RequireRole.php b/app/Http/Middleware/RequireRole.php index c6f8752..ba0a24b 100644 --- a/app/Http/Middleware/RequireRole.php +++ b/app/Http/Middleware/RequireRole.php @@ -5,6 +5,7 @@ namespace App\Http\Middleware; use Closure; use Illuminate\Http\Request; use Symfony\Component\HttpFoundation\Response; +use DB; use App\Models\Auth\UserRole; use App\Models\Auth\AvailableUserRole; @@ -15,8 +16,6 @@ class RequireRole * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next - * @param \Closure $next - * @return mixed */ public function handle(Request $request, Closure $next, $role): Response { diff --git a/app/Http/Middleware/ValidateJwt.php b/app/Http/Middleware/ValidateJwt.php index 6fdeefc..8930585 100644 --- a/app/Http/Middleware/ValidateJwt.php +++ b/app/Http/Middleware/ValidateJwt.php @@ -11,6 +11,12 @@ use Throwable; class ValidateJwt { + + /** + * Handle an incoming request. + * + * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next + */ public function handle(Request $request, Closure $next, JwtService $jwtService): Response { $header = $request->header('Authorization'); diff --git a/app/Library/Login/LoginHelper.php b/app/Library/Login/LoginHelper.php deleted file mode 100644 index 599f57b..0000000 --- a/app/Library/Login/LoginHelper.php +++ /dev/null @@ -1,330 +0,0 @@ - $user->id])->count(); - - //Check to see if the new character being added is already a main character - $mainCount = User::where(['character_id' => $user->id])->count(); - - //If not already in the database, then add the new character - if($altCount == 0 && $mainCount == 0) { - //Create the new alt in the table - $newAlt = new UserAlt; - $newAlt->name = $user->getName(); - $newAlt->main_id = $orgCharacter; - $newAlt->character_id = $user->id; - $newAlt->avatar = $user->avatar; - $newAlt->access_token = $user->token; - $newAlt->owner_hash = $user->owner_hash; - $newAlt->inserted_at = time(); - $newAlt->expires_in = $user->expiresIn; - $newAlt->save(); - - //Create the entry into the EsiToken table - if(EsiToken::where(['character_id' => $user->id])->count() == 0) { - $this->SaveEsiToken($user); - } else { - $this->UpdateEsiToken($user); - } - - //Create the entry into the EsiScopes table - if(sizeof($user->scopes) > 1) { - $this->SetScopes($user->scopes, $user->id); - } - //Return the successfull conclusion of the function - return 1; - } else { - //Return the unsuccessfull conclusion of the function - return 0; - } - } - - /** - * Check if a user exists in the database and return the user object. - * - * @param \Laravel\Socialite\User $user - */ - private function createOrGetUser($eveUser) { - $authUser = null; - - //Search to see if we have a matching user in the database. - //At this point we don't care about the information - $userCount = User::where([ - 'character_id' => $eveUser->id, - ])->count(); - - //If the user is found, do more checks to see what type of login we are doing - if($userCount > 0) { - //Search for user in the database - $authUser = User::where([ - 'character_id' => $eveUser->id, - ])->first(); - - //Check to see if the owner has changed - //If the owner has changed, then update their roles and permissions - if($this->OwnerHasChanged($authUser->owner_hash, $eveUser->owner_hash)) { - //Get the right role for the user - $role = $this->GetRole(null, $eveUser->id); - //Set the role for the user - $this->SetRole($role, $eveUser->id); - - //Update the user information never the less. - $this->UpdateUser($eveUser, $role); - - //Update the user's roles and permission - $this->UpdatePermission($eveUser, $role); - } - - //Return the user to the calling auth function - return $authUser; - } else { - //Get the role for the character to be stored in the database - $role = $this->GetRole(null, $eveUser->id); - - //Create the user account - $user = $this->CreateNewUser($eveUser); - - //Set the role for the user - $this->SetRole($role, $eveUser->id); - - //Create a user account - return $user; - } - } - - /** - * Update the ESI Token - * - * @return null - */ - private function UpdateEsiToken($eveUser) { - EsiToken::where('character_id', $eveUser->id->update([ - 'character_id' => $eveUser->getId(), - 'access_token' => $eveUser->token, - 'refresh_token' => $eveUser->refreshToken, - 'inserted_at' => time(), - 'expires_in' => $eveuser->expiresIn, - ])); - } - - /** - * Create a new ESI Token in the database - * - * @return null - */ - private function SaveEsiToken($eveUser) { - $token = new EsiToken; - $token->character_id = $eveUser->id; - $token->access_token = $eveUser->token; - $token->refresh_token = $eveUser->refreshToken; - $token->inserted_at = time(); - $token->expires_in = $eveUser->expiresIn; - $token->save(); - } - - /** - * Update avatar - */ - private function UpdateAvatar($eveUser) { - User::where('character_id', $eveUser->id)->update([ - 'avatar' => $eveUser->avatar, - ]); - } - - /** - * Update user permission - */ - private function UpdatePermission($eveUser, $role) { - UserPermission::where(['character_id' => $eveUser->id])->delete(); - $perm = new UserPermission(); - $perm->character_id = $eveUser->id; - $perm->permission = $role; - $perm->save(); - } - - /** - * Update the user - */ - private function UpdateUser($eveUser, $role) { - User::where('character_id', $eveUser->id)->update([ - 'avatar' => $eveUser->avatar, - 'owner_hash' => $eveUser->owner_hash, - 'role' => $role, - ]); - } - - /** - * Create a new user account - */ - private function CreateNewUser($eveUser) { - $user = User::create([ - 'name' => $eveUser->getName(), - 'avatar' => $eveUser->avatar, - 'owner_hash' => $eveUser->owner_hash, - 'character_id' => $eveUser->getId(), - 'inserted_at' => time(), - 'expires_in' => $eveUser->expiresIn, - 'user_type' => $this->GetAccountType(null, $eveUser->id), - ]); - - //Look for an existing token for the characters - $tokenFound = EsiToken::where([ - 'character_id' => $eveUser->id, - ])->count(); - - if($tokenFound == 0) { - $token = new EsiToken; - $token->character_id = $eveUser->id; - $token->access_token = $eveUser->token; - $token->refresh_token = $eveUser->refreshToken; - $token->inserted_at = time(); - $token->expires_in = $eveUser->expiresIn; - $token->save(); - } else { - EsiToken::where([ - 'character_id' => $eveUser->id, - ])->update([ - 'character_id' => $eveUser->id, - 'access_token' => $eveUser->token, - 'refresh_token' => $eveUser->refreshToken, - 'inserted_at' => time(), - 'expires_in' => $eveUser->expiresIn, - ]); - } - - return $user; - } - - /** - * Set the user role in the database - * - * @param role - * @param charId - */ - private function SetRole($role, $charId) { - $permission = new UserRole; - $permission->character_id = $charId; - $permission->role = $role; - $permission->save(); - } - - /** - * Set the user scopes in the database - * - * @param scopes - * @param charId - */ - private function SetScopes($scopes, $charId) { - //Delete the current scopes, so we can add new scopes into the database - EsiScope::where('character_id', $charId)->delete(); - foreach($scopes as $scope) { - $data = new EsiScope; - $data->character_id = $charId; - $data->scope = $scope; - $data->save(); - } - } - - /** - * Get the current owner hash, and compare it with the new owner hash - * - * @param hash - * @param charId - */ - private function OwnerHasChanged($hash, $newHash) { - if($hash === $newHash) { - return false; - } else { - return true; - } - } - - /** - * Get the account type and returns it - * - * @param refreshToken - * @param character_id - */ - private function GetRole($refreshToken, $charId) { - $accountType = $this->GetAccountType($refreshToken, $charId); - if($accountType == 'Guest') { - $role = 'Guest'; - } else if($accountType == 'Legacy'){ - $role = 'User'; - } else if($accountType == 'W4RP') { - $role = 'User'; - } elseif($accountType == 'Renter') { - $role = 'Renter'; - } else { - $role = 'None'; - } - - return $role; - } - - /** - * Gets the appropriate account type the user should be assigned through ESI API - * - * @param refreshToken - * @param charId - * - * @return text - */ - private function GetAccountType($refreshToken, $charId) { - //Declare some variables - $esiHelper = new Esi; - $lookup = new LookupHelper; - - //Instantiate a new ESI isntance - $esi = $esiHelper->SetupEsiAuthentication(); - - //Set caching to null - $configuration = Configuration::getInstance(); - $configuration->cache = NullCache::class; - - //Get the character information - $character_info = $lookup->GetCharacterInfo($charId); - - //Get the corporation information - $corp_info = $lookup->GetCorporationInfo($character_info->corporation_id); - - if($character_info == null || $corp_info == null) { - return redirect('/')->with('error', 'Could not create user at this time.'); - } - - $legacy = AllowedLogin::where(['login_type' => 'Legacy'])->pluck('entity_id')->toArray(); - $renter = AllowedLogin::where(['login_type' => 'Renter'])->pluck('entity_id')->toArray(); - - //Send back the appropriate group - if(isset($corp_info->alliance_id)) { - if($corp_info->alliance_id == '99004116') { - return 'W4RP'; - } else if(in_array($corp_info->alliance_id, $legacy)) { - return 'Legacy'; - } else if(in_array($corp_info->alliance_id, $renter)) { - return 'Renter'; - } else { - return 'Guest'; - } - } else { - return 'None'; - } - } -} - -?> \ No newline at end of file diff --git a/app/Library/Moons/MoonCalc.php b/app/Library/Moons/MoonCalc.php deleted file mode 100644 index 92bac0f..0000000 --- a/app/Library/Moons/MoonCalc.php +++ /dev/null @@ -1,626 +0,0 @@ - $ore, - ])->first(); - - return $composition; - } - - /** - * Calculate the total worth of a moon - */ - public function MoonTotalWorth($firstOre = null, $firstQuan = 0.00, $secondOre = null, $secondQuan = 0.00, $thirdOre = null, $thirdQuan = 0.00, $fourthOre = null, $fourthQuan = 0.00) { - //Declare variables - $total = 0.00; - - //Convert the quantities into numbers we want to utilize - $this->ConvertPercentages($firstQuan, $secondQuan, $thirdQuan, $fourthQuan); - - //Calculate the prices from the ores - if($firstOre != null) { - $total += $this->CalcMoonPrice($firstOre, $firstQuan); - } - if($secondOre != null) { - $total += $this->CalcMoonPrice($secondOre, $secondQuan); - } - if($thirdOre != null) { - $total += $this->CalcMoonPrice($thirdOre, $thirdQuan); - } - if($fourthOre != null) { - $total += $this->CalcMoonPrice($fourthOre, $fourthQuan); - } - - //Return the rental price to the caller - return $total; - } - - /** - * Fetch new prices for items from the market - */ - public function FetchNewPrices() { - //Create the item id array which we will pull data for from Fuzzwork market api - $ItemIDs = array( - "Tritanium" => 34, - "Pyerite" => 35, - "Mexallon" => 36, - "Isogen" => 37, - "Nocxium" => 38, - "Zydrine" => 39, - "Megacyte" => 40, - "Morphite" => 11399, - "HeliumIsotopes" => 16274, - "NitrogenIsotopes" => 17888, - "OxygenIsotopes" => 17887, - "HydrogenIsotopes" => 17889, - "LiquidOzone" => 16273, - "HeavyWater" => 16272, - "StrontiumClathrates" => 16275, - "AtmosphericGases" => 16634, - "EvaporiteDeposits" => 16635, - "Hydrocarbons" => 16633, - "Silicates" => 16636, - "Cobalt" => 16640, - "Scandium" => 16639, - "Titanium" => 16638, - "Tungsten" => 16637, - "Cadmium" => 16643, - "Platinum" => 16644, - "Vanadium" => 16642, - "Chromium" => 16641, - "Technetium" => 16649, - "Hafnium" => 16648, - "Caesium" => 16647, - "Mercury" => 16646, - "Dysprosium" => 16650, - "Neodymium" => 16651, - "Promethium" => 16652, - "Thulium" => 16653, - ); - - //Create the time variable - $time = Carbon::now(); - - //Get the json data for each ItemId from https://market.fuzzwork.co.uk/api/ - //Base url is https://market.fuzzwork.co.uk/aggregates/?region=10000002&types=34 - //Going to use curl for these requests - foreach($ItemIDs as $key => $value) { - //Declare a new array each time we cycle through the for loop for the item - $item = array(); - - //Setup the guzzle client fetch object - $client = new Client(['base_uri' => 'https://market.fuzzwork.co.uk/aggregates/']); - //Setup the uri for the guzzle client - $uri = '?region=10000002&types=' . $value; - //Get the result from the guzzle client request - $result = $client->request('GET', $uri); - //Decode the request into an array from the json body return - $item = json_decode($result->getBody(), true); - - //Save the entry into the database - $price = new MineralPrice; - $price->Name = $key; - $price->ItemId = $value; - $price->Price = $item[$value]['sell']['median']; - $price->Time = $time; - $price->save(); - } - - //Run the update for the item pricing - $this->UpdateItemPricing(); - } - - /** - * Calculate the ore units - */ - public function CalcOreUnits($ore, $percentage) { - //Specify the total pull amount - $totalPull = 5.55 * (3600.00 * 24.00 *30.00); - - //Find the size of the asteroid from the database - $item = ItemComposition::where([ - 'Name' => $ore, - ])->first(); - - //Get the m3 size from the item composition - $m3Size = $item->m3Size; - - //Calculate the actual m3 from the total pull amount in m3 using the percentage of the ingredient - $actualm3 = floor($totalPull * $percentage); - - //Calculate the units from the m3 pulled from the moon - $units = floor($actualm3 / $m3Size); - - //Return the calculated data - return $units; - } - - /** - * Calculate the per item price of a unit of ore - */ - public function CalculateOrePrice($oreId) { - //Declare variables - $lookupHelper = new LookupHelper; - $finalName = null; - - $pastTime = Carbon::now()->subDays(30); - - //Get the price of the moongoo - $tritaniumPrice = MineralPrice::where(['ItemId' => 34])->where('Time', '>', $pastTime)->avg('Price'); - $pyeritePrice = MineralPrice::where(['ItemId' => 35])->where('Time', '>', $pastTime)->avg('Price'); - $mexallonPrice = MineralPrice::where(['ItemId' => 36])->where('Time', '>', $pastTime)->avg('Price'); - $isogenPrice = MineralPrice::where(['ItemId' => 37])->where('Time', '>', $pastTime)->avg('Price'); - $nocxiumPrice = MineralPrice::where(['ItemId' => 38])->where('Time', '>', $pastTime)->avg('Price'); - $zydrinePrice = MineralPrice::where(['ItemId' => 39])->where('Time', '>', $pastTime)->avg('Price'); - $megacytePrice = MineralPrice::where(['ItemId' => 40])->where('Time', '>', $pastTime)->avg('Price'); - $atmosphericGasesPrice = MineralPrice::where(['ItemId' => 16634])->where('Time', '>', $pastTime)->avg('Price'); - $evaporiteDepositsPirce = MineralPrice::where(['ItemId' => 16635])->where('Time', '>', $pastTime)->avg('Price'); - $hydrocarbonsPrice = MineralPrice::where(['ItemId' => 16633])->where('Time', '>', $pastTime)->avg('Price'); - $silicatesPrice = MineralPrice::where(['ItemId' => 16636])->where('Time', '>', $pastTime)->avg('Price'); - $cobaltPrice = MineralPrice::where(['ItemId' => 16640])->where('Time', '>', $pastTime)->avg('Price'); - $scandiumPrice = MineralPrice::where(['ItemId' => 16639])->where('Time', '>', $pastTime)->avg('Price'); - $titaniumPrice = MineralPrice::where(['ItemId' => 16638])->where('Time', '>', $pastTime)->avg('Price'); - $tungstenPrice = MineralPrice::where(['ItemId' => 16637])->where('Time', '>', $pastTime)->avg('Price'); - $cadmiumPrice = MineralPrice::where(['ItemId' => 16643])->where('Time', '>', $pastTime)->avg('Price'); - $platinumPrice = MineralPrice::where(['ItemId' => 16644])->where('Time', '>', $pastTime)->avg('Price'); - $vanadiumPrice = MineralPrice::where(['ItemId' => 16642])->where('Time', '>', $pastTime)->avg('Price'); - $chromiumPrice = MineralPrice::where(['ItemId' => 16641])->where('Time', '>', $pastTime)->avg('Price'); - $technetiumPrice = MineralPrice::where(['ItemId' => 16649])->where('Time', '>', $pastTime)->avg('Price'); - $hafniumPrice = MineralPrice::where(['ItemId' => 16648])->where('Time', '>', $pastTime)->avg('Price'); - $caesiumPrice = MineralPrice::where(['ItemId' => 16647])->where('Time', '>', $pastTime)->avg('Price'); - $mercuryPrice = MineralPrice::where(['ItemId' => 16646])->where('Time', '>', $pastTime)->avg('Price'); - $dysprosiumPrice = MineralPrice::where(['ItemId' => 16650])->where('Time', '>', $pastTime)->avg('Price'); - $neodymiumPrice = MineralPrice::where(['ItemId' => 16651])->where('Time', '>', $pastTime)->avg('Price'); - $promethiumPrice = MineralPrice::where(['ItemId' => 16652])->where('Time', '>', $pastTime)->avg('Price'); - $thuliumPrice = MineralPrice::where(['ItemId' => 16653])->where('Time', '>', $pastTime)->avg('Price'); - - //Get the name through the lookup table - $oreName = $lookupHelper->ItemIdToName($oreId); - - //Strip the prefix from the ore name if it has one. - //Then change the ore id if necessary - $tempName = explode(' ', $oreName); - - if(sizeof($tempName) == 1) { - $finalName = $tempName[0]; - } else { - $finalName = $tempName[sizeof($tempName) - 1]; - $oreId = $lookupHelper->ItemNameToId($finalName); - } - - //Get the item composition for the ore - $composition = ItemComposition::where('ItemId', $oreId)->first(); - - //Calculate the Batch Price - $batchPrice = ( ($composition->Tritanium * $tritaniumPrice) + - ($composition->Pyerite * $pyeritePrice) + - ($composition->Mexallon * $mexallonPrice) + - ($composition->Isogen * $isogenPrice) + - ($composition->Nocxium * $nocxiumPrice) + - ($composition->Zydrine * $zydrinePrice) + - ($composition->Megacyte * $megacytePrice) + - ($composition->AtmosphericGases * $atmosphericGasesPrice) + - ($composition->EvaporiteDeposits * $evaporiteDepositsPirce) + - ($composition->Hydrocarbons * $hydrocarbonsPrice) + - ($composition->Silicates * $silicatesPrice) + - ($composition->Cobalt * $cobaltPrice) + - ($composition->Scandium * $scandiumPrice) + - ($composition->Titanium * $titaniumPrice) + - ($composition->Tungsten * $tungstenPrice) + - ($composition->Cadmium * $cadmiumPrice) + - ($composition->Platinum * $platinumPrice) + - ($composition->Vanadium * $vanadiumPrice) + - ($composition->Chromium * $chromiumPrice)+ - ($composition->Technetium * $technetiumPrice) + - ($composition->Hafnium * $hafniumPrice) + - ($composition->Caesium * $caesiumPrice) + - ($composition->Mercury * $mercuryPrice) + - ($composition->Dysprosium * $dysprosiumPrice) + - ($composition->Neodymium * $neodymiumPrice) + - ($composition->Promethium * $promethiumPrice) + - ($composition->Thulium * $thuliumPrice)); - - //Take the batch price, and divide by batch size to get unit price - $price = $batchPrice / $composition->BatchSize; - - //Return the price to the calling function - return $price; - } - - /** - * Update item pricing after new prices were pulled - */ - private function UpdateItemPricing() { - //Get the configuration from the config table - $config = DB::table('Config')->first(); - - //Calculate refine rate - $refineRate = $config->RefineRate / 100.00; - - //Calculate the current time - $time = Carbon::now(); - //Calcualate the current time minus 30 days - $pastTime = Carbon::now()->subDays(30); - - //Get the price of the basic minerals - $tritaniumPrice = MineralPrice::where(['ItemId' => 34])->where('Time', '>', $pastTime)->avg('Price'); - $pyeritePrice = MineralPrice::where(['ItemId' => 35])->where('Time', '>', $pastTime)->avg('Price'); - $mexallonPrice = MineralPrice::where(['ItemId' => 36])->where('Time', '>', $pastTime)->avg('Price'); - $isogenPrice = MineralPrice::where(['ItemId' => 37])->where('Time', '>', $pastTime)->avg('Price'); - $nocxiumPrice = MineralPrice::where(['ItemId' => 38])->where('Time', '>', $pastTime)->avg('Price'); - $zydrinePrice = MineralPrice::where(['ItemId' => 39])->where('Time', '>', $pastTime)->avg('Price'); - $megacytePrice = MineralPrice::where(['ItemId' => 40])->where('Time', '>', $pastTime)->avg('Price'); - $morphitePrice = MineralPrice::where(['ItemId' => 11399])->where('Time', '>', $pastTime)->avg('Price'); - $heliumIsotopesPrice = MineralPrice::where(['ItemId' => 16274])->where('Time', '>', $pastTime)->avg('Price'); - $nitrogenIsotopesPrice = MineralPrice::where(['ItemId' => 17888])->where('Time', '>', $pastTime)->avg('Price'); - $oxygenIsotopesPrice = MineralPrice::where(['ItemId' => 17887])->where('Time', '>', $pastTime)->avg('Price'); - $hydrogenIsotopesPrice = MineralPrice::where(['ItemId' => 17889])->where('Time', '>', $pastTime)->avg('Price'); - $liquidOzonePrice = MineralPrice::where(['ItemId' => 16273])->where('Time', '>', $pastTime)->avg('Price'); - $heavyWaterPrice = MineralPrice::where(['ItemId' => 16272])->where('Time', '>', $pastTime)->avg('Price'); - $strontiumClathratesPrice = MineralPrice::where(['ItemId' => 16275])->where('Time', '>', $pastTime)->avg('Price'); - //Get the price of the moongoo - $atmosphericGasesPrice = MineralPrice::where(['ItemId' => 16634])->where('Time', '>', $pastTime)->avg('Price'); - $evaporiteDepositsPirce = MineralPrice::where(['ItemId' => 16635])->where('Time', '>', $pastTime)->avg('Price'); - $hydrocarbonsPrice = MineralPrice::where(['ItemId' => 16633])->where('Time', '>', $pastTime)->avg('Price'); - $silicatesPrice = MineralPrice::where(['ItemId' => 16636])->where('Time', '>', $pastTime)->avg('Price'); - $cobaltPrice = MineralPrice::where(['ItemId' => 16640])->where('Time', '>', $pastTime)->avg('Price'); - $scandiumPrice = MineralPrice::where(['ItemId' => 16639])->where('Time', '>', $pastTime)->avg('Price'); - $titaniumPrice = MineralPrice::where(['ItemId' => 16638])->where('Time', '>', $pastTime)->avg('Price'); - $tungstenPrice = MineralPrice::where(['ItemId' => 16637])->where('Time', '>', $pastTime)->avg('Price'); - $cadmiumPrice = MineralPrice::where(['ItemId' => 16643])->where('Time', '>', $pastTime)->avg('Price'); - $platinumPrice = MineralPrice::where(['ItemId' => 16644])->where('Time', '>', $pastTime)->avg('Price'); - $vanadiumPrice = MineralPrice::where(['ItemId' => 16642])->where('Time', '>', $pastTime)->avg('Price'); - $chromiumPrice = MineralPrice::where(['ItemId' => 16641])->where('Time', '>', $pastTime)->avg('Price'); - $technetiumPrice = MineralPrice::where(['ItemId' => 16649])->where('Time', '>', $pastTime)->avg('Price'); - $hafniumPrice = MineralPrice::where(['ItemId' => 16648])->where('Time', '>', $pastTime)->avg('Price'); - $caesiumPrice = MineralPrice::where(['ItemId' => 16647])->where('Time', '>', $pastTime)->avg('Price'); - $mercuryPrice = MineralPrice::where(['ItemId' => 16646])->where('Time', '>', $pastTime)->avg('Price'); - $dysprosiumPrice = MineralPrice::where(['ItemId' => 16650])->where('Time', '>', $pastTime)->avg('Price'); - $neodymiumPrice = MineralPrice::where(['ItemId' => 16651])->where('Time', '>', $pastTime)->avg('Price'); - $promethiumPrice = MineralPrice::where(['ItemId' => 16652])->where('Time', '>', $pastTime)->avg('Price'); - $thuliumPrice = MineralPrice::where(['ItemId' => 16653])->where('Time', '>', $pastTime)->avg('Price'); - - //Get the item compositions - $items = DB::select('SELECT Name,ItemId FROM ItemComposition'); - //Go through each of the items and update the price - foreach($items as $item) { - //Get the item composition - $composition = ItemComposition::where('ItemId', $item->ItemId)->first(); - - //Calculate the Batch Price - $batchPrice = ( ($composition->Tritanium * $tritaniumPrice) + - ($composition->Pyerite * $pyeritePrice) + - ($composition->Mexallon * $mexallonPrice) + - ($composition->Isogen * $isogenPrice) + - ($composition->Nocxium * $nocxiumPrice) + - ($composition->Zydrine * $zydrinePrice) + - ($composition->Megacyte * $megacytePrice) + - ($composition->Morphite * $morphitePrice) + - ($composition->HeavyWater * $heavyWaterPrice) + - ($composition->LiquidOzone * $liquidOzonePrice) + - ($composition->NitrogenIsotopes * $nitrogenIsotopesPrice) + - ($composition->HeliumIsotopes * $heliumIsotopesPrice) + - ($composition->HydrogenIsotopes * $hydrogenIsotopesPrice) + - ($composition->OxygenIsotopes * $oxygenIsotopesPrice) + - ($composition->StrontiumClathrates * $strontiumClathratesPrice) + - ($composition->AtmosphericGases * $atmosphericGasesPrice) + - ($composition->EvaporiteDeposits * $evaporiteDepositsPirce) + - ($composition->Hydrocarbons * $hydrocarbonsPrice) + - ($composition->Silicates * $silicatesPrice) + - ($composition->Cobalt * $cobaltPrice) + - ($composition->Scandium * $scandiumPrice) + - ($composition->Titanium * $titaniumPrice) + - ($composition->Tungsten * $tungstenPrice) + - ($composition->Cadmium * $cadmiumPrice) + - ($composition->Platinum * $platinumPrice) + - ($composition->Vanadium * $vanadiumPrice) + - ($composition->Chromium * $chromiumPrice)+ - ($composition->Technetium * $technetiumPrice) + - ($composition->Hafnium * $hafniumPrice) + - ($composition->Caesium * $caesiumPrice) + - ($composition->Mercury * $mercuryPrice) + - ($composition->Dysprosium * $dysprosiumPrice) + - ($composition->Neodymium * $neodymiumPrice) + - ($composition->Promethium * $promethiumPrice) + - ($composition->Thulium * $thuliumPrice)); - //Calculate the batch price with the refine rate included - //Batch Price is base price for everything - $batchPrice = $batchPrice * $refineRate; - //Calculate the unit price - $price = $batchPrice / $composition->BatchSize; - //Calculate the m3 price - $m3Price = $price / $composition->m3Size; - - //Check if an item is in the table - $count = OrePrice::where('Name', $composition->Name)->count(); - if($count == 0) { - //If the ore wasn't found, then add a new entry - $ore = new OrePrice; - $ore->Name = $composition->Name; - $ore->ItemId = $composition->ItemId; - $ore->BatchPrice = $batchPrice; - $ore->UnitPrice = $price; - $ore->m3Price = $m3Price; - $ore->Time = $time; - $ore->save(); - } else { - //Update the prices in the Prices table - OrePrice::where('Name', $composition->Name)->update([ - 'Name' => $composition->Name, - 'ItemId' => $composition->ItemId, - 'BatchPrice' => $batchPrice, - 'UnitPrice' => $price, - 'm3Price' => $m3Price, - 'Time' => $time, - ]); - } - } - } - - /** - * Calculate the total amount pulled from a moon - */ - private function CalculateTotalMoonPull() { - //Always assume a 1 month pull which equates to 5.55m3 per second or 2,592,000 seconds - //Total pull size is 14,385,600 m3 - $totalPull = 5.55 * 3600.00 * 24.00 *30.00; - - //Return the total pull - return $totalPull; - } - - /** - * Calculate the rental price of a moon ore from the moon - */ - private function CalcRentalPrice($ore, $percentage) { - //Specify the total pull amount - $totalPull = $this->CalculateTotalMoonPull(); - - //Setup the total value at 0.00 - $totalPrice = 0.00; - - //Check to see what type of moon goo the moon is - $gasMoonOre = $this->IsGasMoonGoo($ore); - - //Find the size of the asteroid from the database - $m3Size = DB::table('ItemComposition')->where('Name', $ore)->value('m3Size'); - - //Calculate the actual m3 from the total pull amount in m3 using the percentage of the ingredient - $actualm3 = floor($percentage * $totalPull); - - //Calculate the units once we have the size and actual m3 value - $units = floor($actualm3 / $m3Size); - - //Look up the unit price from the database - $unitPrice = DB::table('ore_prices')->where('Name', $ore)->value('UnitPrice'); - - //If the ore is a gas ore, then take only 50% of the price. - if($gasMoonOre == true) { - $totalPrice = $units * ($unitPrice / 2.00); - Log::warning('Found gas ore: ' . $totalPrice); - } else { - $totalPrice = $units * $unitPrice; - } - - //Return the total - return $totalPrice; - } - - /** - * Calculate the moon's total price - */ - public function CalcMoonPrice($ore, $percentage) { - //Specify the total pull amount - $totalPull = $this->CalculateTotalMoonPull(); - - //Setup the total value at 0.00 - $totalPrice = 0.00; - - //Find the size of the asteroid from the database - $m3Size = DB::table('ItemComposition')->where('Name', $ore)->value('m3Size'); - - //Calculate the actual m3 from the total pull amount in m3 using the percentage of the ingredient - $actualm3 = floor($percentage * $totalPull); - - //Calculate the units once we have the size and actual m3 value - $units = floor($actualm3 / $m3Size); - - //Look up the unit price from the database - $unitPrice = DB::table('ore_prices')->where('Name', $ore)->value('UnitPrice'); - - //Calculate the total amount from the units and the unit price. - $totalPrice = $units * $unitPrice; - - //Return the value - return $totalPrice; - } - - /** - * Convert a number to a percentage - */ - private function ConvertToPercentage($quantity) { - //Perform the calculation and return the data - return $quantity / 100.00; - } - - /** - * Return if a type of ore is a gas moon goo - */ - private function IsGasMoonGoo($ore) { - $ores = [ - 'Zeolites' => 'Gas', - 'Sylvite' => 'Gas', - 'Bitumens' => 'Gas', - 'Coesite' => 'Gas', - ]; - - foreach($ores as $key => $value) { - if(strtolower($key) == strtolower($ore)) { - return $value; - } - } - - return false; - } - - /** - * Return the type of ore a particular moon ore is. - */ - public function IsRMoonGoo($ore) { - $ores = [ - 'Zeolites' => 'R4', - 'Sylvite' => 'R4', - 'Bitumens' => 'R4', - 'Coesite' => 'R4', - 'Cobaltite' => 'R8', - 'Euxenite' => 'R8', - 'Titanite' => 'R8', - 'Scheelite' => 'R8', - 'Otavite' => 'R16', - 'Sperrylite' => 'R16', - 'Vanadinite' => 'R16', - 'Chromite' => 'R16', - 'Carnotite' => 'R32', - 'Zircon' => 'R32', - 'Pollucite' => 'R32', - 'Cinnabar' => 'R32', - 'Xenotime' => 'R64', - 'Monazite' => 'R64', - 'Loparite' => 'R64', - 'Ytterbite' => 'R64', - ]; - - foreach($ores as $key => $value) { - if(strtolower($key) == strtolower($ore)) { - return $value; - } - } - - //Return false if the ore is not found in an array - return false; - } - - /** - * Return true if a moon ore is a moon ore, and false - * if the ore is not a moon ore. - */ - public function IsRMoonOre($ore) { - $ores = [ - 'Zeolites' => 'R4', - 'Sylvite' => 'R4', - 'Bitumens' => 'R4', - 'Coesite' => 'R4', - 'Cobaltite' => 'R8', - 'Euxenite' => 'R8', - 'Titanite' => 'R8', - 'Scheelite' => 'R8', - 'Otavite' => 'R16', - 'Sperrylite' => 'R16', - 'Vanadinite' => 'R16', - 'Chromite' => 'R16', - 'Carnotite' => 'R32', - 'Zircon' => 'R32', - 'Pollucite' => 'R32', - 'Cinnabar' => 'R32', - 'Xenotime' => 'R64', - 'Monazite' => 'R64', - 'Loparite' => 'R64', - 'Ytterbite' => 'R64', - ]; - - foreach($ores as $key => $value) { - - if(strtolower($key) == strtolower($ore)) { - return true; - } - } - - return false; - } - - /** - * Convert percentages from quantities into a normalized percentage - */ - public function ConvertPercentages(&$firstPerc, &$secondPerc, &$thirdPerc, &$fourthPerc) { - //Convert the quantities into numbers we want to utilize - if($firstPerc >= 1.00) { - $firstPerc = $this->ConvertToPercentage($firstPerc); - } - - if($secondPerc >= 1.00) { - $secondPerc = $this->ConvertToPercentage($secondPerc); - } - - if($thirdPerc >= 1.00) { - $thirdPerc = $this->ConvertToPercentage($thirdPerc); - } - - if($fourthPerc >= 1.00) { - $fourthPerc = $this->ConvertToPercentage($fourthPerc); - } - - - //Add up all the percentages - $totalPerc = $firstPerc + $secondPerc + $thirdPerc + $fourthPerc; - - //If it is less than 1.00, then we need to normalize the decimal to be 100.0%. - if($totalPerc < 1.00) { - if($firstPerc > 0.00) { - $firstPerc = $firstPerc / $totalPerc; - } else { - $firstPerc = 0.00; - } - - if($secondPerc > 0.00) { - $secondPerc = $secondPerc / $totalPerc; - } else { - $secondPerc = 0.00; - } - - if($thirdPerc > 0.00) { - $thirdPerc = $thirdPerc / $totalPerc; - } else { - $thirdPerc = 0.00; - } - - if($fourthPerc > 0.00) { - $fourthPerc = $fourthPerc / $totalPerc; - } else { - $fourthPerc = 0.00; - } - } - } -} \ No newline at end of file diff --git a/app/Services/UserPrivilegesService.php b/app/Services/UserPrivilegeService.php similarity index 100% rename from app/Services/UserPrivilegesService.php rename to app/Services/UserPrivilegeService.php diff --git a/composer.json b/composer.json index f657fe2..0278bd5 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "license": "MIT", "require": { "php": "^8.2", + "drkthunder02/eseye": "^0.1.0", "firebase/php-jwt": "^7.0", "laravel/framework": "^12.0", "laravel/horizon": "^5.44", diff --git a/composer.lock b/composer.lock index 7b6db99..b2d425b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "96d48de8716953a0f65cbe1a3e44143c", + "content-hash": "a6ca21d50e67ef5fcc522aeffba97342", "packages": [ { "name": "brick/math", @@ -441,6 +441,69 @@ ], "time": "2025-10-31T18:51:33+00:00" }, + { + "name": "drkthunder02/eseye", + "version": "v0.1", + "source": { + "type": "git", + "url": "https://github.com/drkthunder02/eseye.git", + "reference": "2e9a4ee1ecf0d468b4e1dfcbc3dcbddf870a571c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/drkthunder02/eseye/zipball/2e9a4ee1ecf0d468b4e1dfcbc3dcbddf870a571c", + "reference": "2e9a4ee1ecf0d468b4e1dfcbc3dcbddf870a571c", + "shasum": "" + }, + "require": { + "ext-gmp": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "guzzlehttp/guzzle": "^6.2|^7.0", + "monolog/monolog": "^3.0", + "nesbot/carbon": "^3.0", + "php": ">= 8.1", + "predis/predis": "^1.1", + "web-token/jwt-easy": "^2.1", + "web-token/jwt-signature-algorithm-ecdsa": "^2.1", + "web-token/jwt-signature-algorithm-hmac": "^2.1", + "web-token/jwt-signature-algorithm-rsa": "^2.1" + }, + "require-dev": { + "codeclimate/php-test-reporter": "dev-master", + "m6web/redis-mock": "^5.0", + "mikey179/vfsstream": "~1", + "phpunit/phpunit": "^8.0|^9.0" + }, + "bin": [ + "bin/tokengenerator" + ], + "type": "library", + "autoload": { + "files": [ + "src/Helpers/helpers.php" + ], + "psr-4": { + "Seat\\Eseye\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Leon Jacobs", + "email": "leonja511@gmail.com" + } + ], + "description": "A Standalone PHP ESI (EVE Swagger Interface) Client Library. Originally by eveseat/eseye.", + "support": { + "source": "https://github.com/drkthunder02/eseye/tree/v0.1" + }, + "time": "2026-03-11T00:56:23+00:00" + }, { "name": "egulias/email-validator", "version": "4.0.4", @@ -508,6 +571,82 @@ ], "time": "2025-03-06T22:45:56+00:00" }, + { + "name": "fgrosse/phpasn1", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/fgrosse/PHPASN1.git", + "reference": "42060ed45344789fb9f21f9f1864fc47b9e3507b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/42060ed45344789fb9f21f9f1864fc47b9e3507b", + "reference": "42060ed45344789fb9f21f9f1864fc47b9e3507b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "~2.0", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "suggest": { + "ext-bcmath": "BCmath is the fallback extension for big integer calculations", + "ext-curl": "For loading OID information from the web if they have not bee defined statically", + "ext-gmp": "GMP is the preferred extension for big integer calculations", + "phpseclib/bcmath_compat": "BCmath polyfill for servers where neither GMP nor BCmath is available" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "FG\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Friedrich Große", + "email": "friedrich.grosse@gmail.com", + "homepage": "https://github.com/FGrosse", + "role": "Author" + }, + { + "name": "All contributors", + "homepage": "https://github.com/FGrosse/PHPASN1/contributors" + } + ], + "description": "A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.", + "homepage": "https://github.com/FGrosse/PHPASN1", + "keywords": [ + "DER", + "asn.1", + "asn1", + "ber", + "binary", + "decoding", + "encoding", + "x.509", + "x.690", + "x509", + "x690" + ], + "support": { + "issues": "https://github.com/fgrosse/PHPASN1/issues", + "source": "https://github.com/fgrosse/PHPASN1/tree/v2.5.0" + }, + "abandoned": true, + "time": "2022-12-19T11:08:26+00:00" + }, { "name": "firebase/php-jwt", "version": "v7.0.3", @@ -3185,6 +3324,72 @@ ], "time": "2026-01-27T09:17:28+00:00" }, + { + "name": "predis/predis", + "version": "v1.1.10", + "source": { + "type": "git", + "url": "https://github.com/predis/predis.git", + "reference": "a2fb02d738bedadcffdbb07efa3a5e7bd57f8d6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/predis/predis/zipball/a2fb02d738bedadcffdbb07efa3a5e7bd57f8d6e", + "reference": "a2fb02d738bedadcffdbb07efa3a5e7bd57f8d6e", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "suggest": { + "ext-curl": "Allows access to Webdis when paired with phpiredis", + "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" + }, + "type": "library", + "autoload": { + "psr-4": { + "Predis\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniele Alessandri", + "email": "suppakilla@gmail.com", + "homepage": "http://clorophilla.net", + "role": "Creator & Maintainer" + }, + { + "name": "Till Krüss", + "homepage": "https://till.im", + "role": "Maintainer" + } + ], + "description": "Flexible and feature-complete Redis client for PHP and HHVM", + "homepage": "http://github.com/predis/predis", + "keywords": [ + "nosql", + "predis", + "redis" + ], + "support": { + "issues": "https://github.com/predis/predis/issues", + "source": "https://github.com/predis/predis/tree/v1.1.10" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tillkruss", + "type": "github" + } + ], + "time": "2022-01-05T17:46:08+00:00" + }, { "name": "psr/clock", "version": "1.0.0", @@ -3999,6 +4204,71 @@ }, "time": "2025-02-24T19:33:30+00:00" }, + { + "name": "spomky-labs/base64url", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/Spomky-Labs/base64url.git", + "reference": "7752ce931ec285da4ed1f4c5aa27e45e097be61d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Spomky-Labs/base64url/zipball/7752ce931ec285da4ed1f4c5aa27e45e097be61d", + "reference": "7752ce931ec285da4ed1f4c5aa27e45e097be61d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.11|^0.12", + "phpstan/phpstan-beberlei-assert": "^0.11|^0.12", + "phpstan/phpstan-deprecation-rules": "^0.11|^0.12", + "phpstan/phpstan-phpunit": "^0.11|^0.12", + "phpstan/phpstan-strict-rules": "^0.11|^0.12" + }, + "type": "library", + "autoload": { + "psr-4": { + "Base64Url\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky-Labs/base64url/contributors" + } + ], + "description": "Base 64 URL Safe Encoding/Decoding PHP Library", + "homepage": "https://github.com/Spomky-Labs/base64url", + "keywords": [ + "base64", + "rfc4648", + "safe", + "url" + ], + "support": { + "issues": "https://github.com/Spomky-Labs/base64url/issues", + "source": "https://github.com/Spomky-Labs/base64url/tree/v2.0.4" + }, + "funding": [ + { + "url": "https://github.com/Spomky", + "type": "github" + }, + { + "url": "https://www.patreon.com/FlorentMorselli", + "type": "patreon" + } + ], + "time": "2020-11-03T09:10:25+00:00" + }, { "name": "symfony/clock", "version": "v7.4.0", @@ -6712,6 +6982,632 @@ } ], "time": "2024-11-21T01:49:47+00:00" + }, + { + "name": "web-token/jwt-checker", + "version": "v2.2.11", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-checker.git", + "reference": "5f31d98155951739e2fae7455e8466ccddd08f50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-checker/zipball/5f31d98155951739e2fae7455e8466ccddd08f50", + "reference": "5f31d98155951739e2fae7455e8466ccddd08f50", + "shasum": "" + }, + "require": { + "web-token/jwt-core": "^2.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Jose\\Component\\Checker\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-checker/contributors" + } + ], + "description": "Checker component of the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "support": { + "source": "https://github.com/web-token/jwt-checker/tree/v2.2.11" + }, + "funding": [ + { + "url": "https://www.patreon.com/FlorentMorselli", + "type": "patreon" + } + ], + "abandoned": "web-token/jwt-library", + "time": "2021-03-17T14:55:52+00:00" + }, + { + "name": "web-token/jwt-core", + "version": "v2.2.3", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-core.git", + "reference": "0909efa4fe2c3e2d537922b3ea1b65eb8203686c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-core/zipball/0909efa4fe2c3e2d537922b3ea1b65eb8203686c", + "reference": "0909efa4fe2c3e2d537922b3ea1b65eb8203686c", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "fgrosse/phpasn1": "^2.0", + "php": ">=7.2", + "spomky-labs/base64url": "^1.0|^2.0" + }, + "conflict": { + "spomky-labs/jose": "*" + }, + "require-dev": { + "phpunit/phpunit": "^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "v1.0": "1.0.x-dev", + "v1.1": "1.1.x-dev", + "v1.2": "1.2.x-dev", + "v1.3": "1.3.x-dev", + "v2.0": "2.0.x-dev", + "v2.1": "2.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jose\\Component\\Core\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "description": "Core component of the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "support": { + "source": "https://github.com/web-token/jwt-core/tree/v2.2" + }, + "funding": [ + { + "url": "https://www.patreon.com/FlorentMorselli", + "type": "patreon" + } + ], + "abandoned": "web-token/jwt-library", + "time": "2020-08-22T13:17:25+00:00" + }, + { + "name": "web-token/jwt-easy", + "version": "v2.2.11", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-easy.git", + "reference": "01db23252bb53d4fd36975b55dd58466bab1bb30" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-easy/zipball/01db23252bb53d4fd36975b55dd58466bab1bb30", + "reference": "01db23252bb53d4fd36975b55dd58466bab1bb30", + "shasum": "" + }, + "require": { + "web-token/jwt-checker": "^2.1", + "web-token/jwt-encryption": "^2.1", + "web-token/jwt-signature": "^2.1" + }, + "suggest": { + "web-token/jwt-encryption-algorithm-aescbc": "Adds AES-CBC based encryption algorithms", + "web-token/jwt-encryption-algorithm-aesgcm": "Adds AES-GCM based encryption algorithms", + "web-token/jwt-encryption-algorithm-aesgcmkw": "Adds AES-GCM Key Wrapping based encryption algorithms", + "web-token/jwt-encryption-algorithm-aeskw": "Adds AES Key Wrapping based encryption algorithms", + "web-token/jwt-encryption-algorithm-dir": "Adds Direct encryption algorithm", + "web-token/jwt-encryption-algorithm-ecdh-es": "Adds ECDH-ES based encryption algorithms", + "web-token/jwt-encryption-algorithm-pbes2": "Adds PBES2 based encryption algorithms", + "web-token/jwt-encryption-algorithm-rsa": "Adds RSA based encryption algorithms", + "web-token/jwt-signature-algorithm-ecdsa": "Adds ECDSA based signature algorithms", + "web-token/jwt-signature-algorithm-eddsa": "Adds EdDSA based signature algorithms", + "web-token/jwt-signature-algorithm-hmac": "Adds HMAC based signature algorithms", + "web-token/jwt-signature-algorithm-none": "Adds none signature algorithms", + "web-token/jwt-signature-algorithm-rsa": "Adds RSA based signature algorithms" + }, + "type": "library", + "autoload": { + "psr-4": { + "Jose\\Easy\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "description": "Easy toolset to use the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "support": { + "source": "https://github.com/web-token/jwt-easy/tree/v2.2.11" + }, + "funding": [ + { + "url": "https://www.patreon.com/FlorentMorselli", + "type": "patreon" + } + ], + "abandoned": true, + "time": "2021-03-17T14:55:52+00:00" + }, + { + "name": "web-token/jwt-encryption", + "version": "v2.2.11", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-encryption.git", + "reference": "3b8d67d7c5c013750703e7c27f1001544407bbb2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-encryption/zipball/3b8d67d7c5c013750703e7c27f1001544407bbb2", + "reference": "3b8d67d7c5c013750703e7c27f1001544407bbb2", + "shasum": "" + }, + "require": { + "web-token/jwt-core": "^2.1" + }, + "suggest": { + "web-token/jwt-encryption-algorithm-aescbc": "AES CBC Based Content Encryption Algorithms", + "web-token/jwt-encryption-algorithm-aesgcm": "AES GCM Based Content Encryption Algorithms", + "web-token/jwt-encryption-algorithm-aesgcmkw": "AES GCM Key Wrapping Based Key Encryption Algorithms", + "web-token/jwt-encryption-algorithm-aeskw": "AES Key Wrapping Based Key Encryption Algorithms", + "web-token/jwt-encryption-algorithm-dir": "Direct Key Encryption Algorithms", + "web-token/jwt-encryption-algorithm-ecdh-es": "ECDH-ES Based Key Encryption Algorithms", + "web-token/jwt-encryption-algorithm-experimental": "Experimental Key and Signature Algorithms", + "web-token/jwt-encryption-algorithm-pbes2": "PBES2 Based Key Encryption Algorithms", + "web-token/jwt-encryption-algorithm-rsa": "RSA Based Key Encryption Algorithms" + }, + "type": "library", + "autoload": { + "psr-4": { + "Jose\\Component\\Encryption\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-encryption/contributors" + } + ], + "description": "Encryption component of the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "support": { + "source": "https://github.com/web-token/jwt-encryption/tree/v2.2.11" + }, + "funding": [ + { + "url": "https://www.patreon.com/FlorentMorselli", + "type": "patreon" + } + ], + "abandoned": "web-token/jwt-library", + "time": "2021-03-17T14:55:52+00:00" + }, + { + "name": "web-token/jwt-signature", + "version": "v2.2.11", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature.git", + "reference": "015b59aaf3b6e8fb9f5bd1338845b7464c7d8103" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature/zipball/015b59aaf3b6e8fb9f5bd1338845b7464c7d8103", + "reference": "015b59aaf3b6e8fb9f5bd1338845b7464c7d8103", + "shasum": "" + }, + "require": { + "web-token/jwt-core": "^2.1" + }, + "suggest": { + "web-token/jwt-signature-algorithm-ecdsa": "ECDSA Based Signature Algorithms", + "web-token/jwt-signature-algorithm-eddsa": "EdDSA Based Signature Algorithms", + "web-token/jwt-signature-algorithm-experimental": "Experimental Signature Algorithms", + "web-token/jwt-signature-algorithm-hmac": "HMAC Based Signature Algorithms", + "web-token/jwt-signature-algorithm-none": "None Signature Algorithm", + "web-token/jwt-signature-algorithm-rsa": "RSA Based Signature Algorithms" + }, + "type": "library", + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-signature/contributors" + } + ], + "description": "Signature component of the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "support": { + "source": "https://github.com/web-token/jwt-signature/tree/v2.2.11" + }, + "funding": [ + { + "url": "https://www.patreon.com/FlorentMorselli", + "type": "patreon" + } + ], + "abandoned": "web-token/jwt-library", + "time": "2021-03-01T19:55:28+00:00" + }, + { + "name": "web-token/jwt-signature-algorithm-ecdsa", + "version": "v2.2.11", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-ecdsa.git", + "reference": "44cbbb4374c51f1cf48b82ae761efbf24e1a8591" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-ecdsa/zipball/44cbbb4374c51f1cf48b82ae761efbf24e1a8591", + "reference": "44cbbb4374c51f1cf48b82ae761efbf24e1a8591", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "web-token/jwt-signature": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "description": "ECDSA Based Signature Algorithms the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "support": { + "source": "https://github.com/web-token/jwt-signature-algorithm-ecdsa/tree/v2.2.11" + }, + "funding": [ + { + "url": "https://www.patreon.com/FlorentMorselli", + "type": "patreon" + } + ], + "abandoned": "web-token/jwt-library", + "time": "2021-01-21T19:18:03+00:00" + }, + { + "name": "web-token/jwt-signature-algorithm-hmac", + "version": "v2.2.11", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-hmac.git", + "reference": "d208b1c50b408fa711bfeedeed9fb5d9be1d3080" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-hmac/zipball/d208b1c50b408fa711bfeedeed9fb5d9be1d3080", + "reference": "d208b1c50b408fa711bfeedeed9fb5d9be1d3080", + "shasum": "" + }, + "require": { + "web-token/jwt-signature": "^2.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "description": "HMAC Based Signature Algorithms the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "support": { + "source": "https://github.com/web-token/jwt-signature-algorithm-hmac/tree/v2.2.11" + }, + "funding": [ + { + "url": "https://www.patreon.com/FlorentMorselli", + "type": "patreon" + } + ], + "abandoned": "web-token/jwt-library", + "time": "2021-01-21T19:18:03+00:00" + }, + { + "name": "web-token/jwt-signature-algorithm-rsa", + "version": "v2.1.9", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-rsa.git", + "reference": "2732e6d12bb84f41c2f000ca822e03b6a1e76531" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-rsa/zipball/2732e6d12bb84f41c2f000ca822e03b6a1e76531", + "reference": "2732e6d12bb84f41c2f000ca822e03b6a1e76531", + "shasum": "" + }, + "require": { + "lib-openssl": "*", + "web-token/jwt-signature": "^2.1" + }, + "require-dev": { + "phpunit/phpunit": "^8.0" + }, + "suggest": { + "ext-gmp": "To use PSxxx algorihtms" + }, + "type": "library", + "extra": { + "branch-alias": { + "v1.0": "1.0.x-dev", + "v1.1": "1.1.x-dev", + "v1.2": "1.2.x-dev", + "v1.3": "1.3.x-dev", + "v2.0": "2.0.x-dev", + "v2.1": "2.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "description": "RSA Based Signature Algorithms the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "support": { + "source": "https://github.com/web-token/jwt-signature-algorithm-rsa/tree/v2.1" + }, + "funding": [ + { + "url": "https://www.patreon.com/FlorentMorselli", + "type": "patreon" + } + ], + "abandoned": "web-token/jwt-library", + "time": "2020-05-29T20:21:59+00:00" } ], "packages-dev": [