ScopeInterface.php 984 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace OAuth2;
  3. use OAuth2\Storage\ScopeInterface as ScopeStorageInterface;
  4. /**
  5. * Class to handle scope implementation logic
  6. *
  7. * @see OAuth2\Storage\ScopeInterface
  8. */
  9. interface ScopeInterface extends ScopeStorageInterface
  10. {
  11. /**
  12. * Check if everything in required scope is contained in available scope.
  13. *
  14. * @param $required_scope
  15. * A space-separated string of scopes.
  16. *
  17. * @return
  18. * TRUE if everything in required scope is contained in available scope,
  19. * and FALSE if it isn't.
  20. *
  21. * @see http://tools.ietf.org/html/rfc6749#section-7
  22. *
  23. * @ingroup oauth2_section_7
  24. */
  25. public function checkScope($required_scope, $available_scope);
  26. /**
  27. * Return scope info from request
  28. *
  29. * @param OAuth2\RequestInterface
  30. * Request object to check
  31. *
  32. * @return
  33. * string representation of requested scope
  34. */
  35. public function getScopeFromRequest(RequestInterface $request);
  36. }