Class AdminRegistry

java.lang.Object
io.github.protasm.jvmud.storage.admin.AdminRegistry

public final class AdminRegistry extends Object
Engine-owned administrator identities and grants. Only hashes of random access tokens are stored.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Serialized registry entry; token material never appears here.
    static final record 
    Version-one registry document.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AdminRegistry(Path directory)
    Loads a private registry; an empty registry is bootstrapped through the local console.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    allows(String name, String token, String scope)
    Rechecks both credential validity and scope so revocation affects existing connections.
    boolean
    authenticate(String name, String token)
    Authenticates a token without revealing whether the identity exists.
    create(String name)
    Creates an identity and returns its one-time-displayed 256-bit token.
    Lists identities and grants without disclosing credential hashes.
    void
    grant(String name, String scope, boolean allowed)
    Grants or revokes engine or mudlib:<id> authority; player permissions are unrelated.
    static void
    Creates an owner-only directory and rejects symlinks and directories owned by another account.
    void
    remove(String name)
    Deletes an identity and all its grants.
    rotate(String name)
    Rotates an identity's token, invalidating existing sessions on their next authorization check.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AdminRegistry

      public AdminRegistry(Path directory) throws IOException
      Loads a private registry; an empty registry is bootstrapped through the local console.
      Throws:
      IOException
  • Method Details

    • create

      public String create(String name) throws IOException
      Creates an identity and returns its one-time-displayed 256-bit token.
      Throws:
      IOException
    • rotate

      public String rotate(String name) throws IOException
      Rotates an identity's token, invalidating existing sessions on their next authorization check.
      Throws:
      IOException
    • grant

      public void grant(String name, String scope, boolean allowed) throws IOException
      Grants or revokes engine or mudlib:<id> authority; player permissions are unrelated.
      Throws:
      IOException
    • remove

      public void remove(String name) throws IOException
      Deletes an identity and all its grants.
      Throws:
      IOException
    • authenticate

      public boolean authenticate(String name, String token)
      Authenticates a token without revealing whether the identity exists.
    • allows

      public boolean allows(String name, String token, String scope)
      Rechecks both credential validity and scope so revocation affects existing connections.
    • describe

      public String describe()
      Lists identities and grants without disclosing credential hashes.
    • privateDirectory

      public static void privateDirectory(Path path) throws IOException
      Creates an owner-only directory and rejects symlinks and directories owned by another account.
      Throws:
      IOException