APIKey.class.php 611 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Models {
  3. class APIKey {
  4. //
  5. private $apiKey;
  6. /**
  7. *
  8. */
  9. public function __construct() {
  10. }
  11. /**
  12. * Make sure origin is allowed to use the API.
  13. */
  14. public function verifyKey($apiKey, $origin) {
  15. $this->apiKey = $apiKey;
  16. return true;
  17. }
  18. /**
  19. * Check API permissions using the API key, an endpoint and a method.
  20. */
  21. public function isGranted($endpoint, $method) {
  22. return true;
  23. }
  24. /**
  25. *
  26. */
  27. public function get() {
  28. return $apiKey;
  29. }
  30. }
  31. }
  32. ?>