ScopeInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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 string $required_scope - A space-separated string of scopes.
  15. * @param string $available_scope - A space-separated string of scopes.
  16. * @return boolean - TRUE if everything in required scope is contained in available scope and FALSE
  17. * if it isn't.
  18. *
  19. * @see http://tools.ietf.org/html/rfc6749#section-7
  20. *
  21. * @ingroup oauth2_section_7
  22. */
  23. public function checkScope($required_scope, $available_scope);
  24. /**
  25. * Return scope info from request
  26. *
  27. * @param RequestInterface $request - Request object to check
  28. * @return string - representation of requested scope
  29. */
  30. public function getScopeFromRequest(RequestInterface $request);
  31. }