Identity.vala 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Invercargill.DataStructures;
  2. using Invercargill;
  3. namespace Spry.Authorisation {
  4. /**
  5. * Interface representing an authenticated identity.
  6. *
  7. * Implementations provide identity data that gets embedded in tokens
  8. * and can be retrieved on subsequent requests.
  9. *
  10. * Built-in implementation: Spry.Authentication.User (via UserIdentityProvider)
  11. * Custom implementations: OAuth providers, certificate auth, etc.
  12. */
  13. public interface Identity : GLib.Object {
  14. /**
  15. * Unique identifier for this identity.
  16. * Used to look up the full identity object.
  17. */
  18. public abstract string id { get; }
  19. /**
  20. * Human-readable name for this identity.
  21. * Typically username or email.
  22. */
  23. public abstract string username { get; }
  24. /**
  25. * Permissions granted to this identity.
  26. * Returns an immutable lot of strings for serialization.
  27. */
  28. public abstract ImmutableLot<string> permissions { owned get; }
  29. /**
  30. * Additional data to embed in the token.
  31. * Implementation-specific data (e.g., roles, preferences).
  32. */
  33. public abstract Properties data { owned get; }
  34. }
  35. }