Interface IHubLicence

All Known Implementing Classes:
AllowAllHubLicence

public interface IHubLicence
The interface between the hub and the licence system, HUB-DESIGN.md section 9.2 as LICENSE-V2-DESIGN.md section 13 fills it in: D-LIC owns the numbers, the grace length, the messages and the credential format; the hub fixes only where the counting happens and what crosses it. Implemented by B-9 over the v2 verifier in com.iizix.core; until then the hub module uses AllowAllHubLicence, which admits every member the interim cluster key authenticates, allows every sign-in and counts.
Author:
Christopher Mindus
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the number of members the hub's entitlement allows (R-6, rule 5 of section 2.4).
    onLogin(String memberID, long uid, String appID, boolean transfer)
    A successful sign-in, counted cluster-wide (section 9.1, B-7d's LOGIN event).
    void
    onRelease(String memberID, long uid, String appID)
    The user's last AppSession of the application ended on the member (section 9.1).
    verifyMember(String memberID, byte[] document, byte[] challenge, String run, byte[] signature)
    Verifies a member's document and its answer to the principal's challenge (ruled LV-12 (a)): from B-9 the credential of REGISTER is the member's licence document and its installation key's signature over "iizi-hub-register/1" 0x00 pn member run.
  • Method Details

    • verifyMember

      MemberLicence verifyMember(String memberID, byte[] document, byte[] challenge, String run, byte[] signature)
      Verifies a member's document and its answer to the principal's challenge (ruled LV-12 (a)): from B-9 the credential of REGISTER is the member's licence document and its installation key's signature over "iizi-hub-register/1" 0x00 pn member run. Before B-9 the interim cluster key answers the same challenge with an HMAC, verified by the principal itself (HubClusterKey), and this method is not called. The bytes are never logged.
      Parameters:
      memberID - The member ID the member claims.
      document - The member's licence document.
      challenge - The pn of this connection's CHALLENGE.
      run - The member's run UUID.
      signature - The signature.
      Returns:
      The member's licence, or null to refuse it.
    • getMaxServers

      int getMaxServers()
      Gets the number of members the hub's entitlement allows (R-6, rule 5 of section 2.4).
      Returns:
      The count; Integer.MAX_VALUE for no limit.
    • onLogin

      LoginVerdict onLogin(String memberID, long uid, String appID, boolean transfer)
      A successful sign-in, counted cluster-wide (section 9.1, B-7d's LOGIN event).
      Parameters:
      memberID - The member the user signed in on.
      uid - The user.
      appID - The application.
      transfer - true when the sign-in moves a client (section 7.6): a uid already counted answers ALLOW.
      Returns:
      The verdict.
    • onRelease

      void onRelease(String memberID, long uid, String appID)
      The user's last AppSession of the application ended on the member (section 9.1).
      Parameters:
      memberID - The member.
      uid - The user.
      appID - The application.