Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
Shards


NAME

Shards - abstraction for authorization protocols

SYNOPSIS

TYPE Pot = POINTER TO PotRec;
TYPE PotRec = RECORD (PersistentDisciplines.ObjectRec) END;
TYPE Lid = POINTER TO LidRec;
TYPE LidRec = RECORD (PersistentDisciplines.ObjectRec) END;
TYPE FitsProc = PROCEDURE (pot: Pot; lid: Lid): BOOLEAN;
TYPE SupplyProc = PROCEDURE (pot: Pot; VAR lid: Lid): BOOLEAN;
TYPE Interface = POINTER TO InterfaceRec;
TYPE InterfaceRec =
   RECORD
      (Objects.ObjectRec)
      fits: FitsProc;
      supply: SupplyProc; (* may be NIL *)
   END;


PROCEDURE Fits(pot: Pot; lid: Lid): BOOLEAN; PROCEDURE Supply(pot: Pot; VAR lid: Lid): BOOLEAN; PROCEDURE Init(pot: Pot; if: Interface); PROCEDURE CombineLids(VAR lid: Lid; lid1, lid2: Lid); PROCEDURE CreateSimplePot(VAR pot: Pot; permissive: BOOLEAN);

DESCRIPTION

Shards come in two types, Pot and Lid, to serve as tokens in authorization protocols. A pot is an object that can tell whether a given lid object fits to it. Some pot objects can also supply new lids guaranteed to fit to them.

Both of the most trivial cases of pots (either accepting any or no lid at all) can be obtained using CreateSimplePot.

By convention, it is always legal to use NIL for a lid that is supposed to fit to none but simple pots of the permissive kind.

CombineLids creates a new lid fitting to any pot at least one of lid1 or lid2 fits to. Note that lid1 will always be considered first.

Implementors of other shard types must initialize their pots using Init. The if.fits method will be called with lids of any type, but not NIL. Thus it should in general perform a type test on lid prior to its implementation-specific verification procedure.

Note that the Boolean result of Fits is not an error indicator. If if.supply is NIL, Supply will always return FALSE.

SEE ALSO

PrivateShards
standard nontrivial shards implementation
PersistentObjects
abstraction for persistent objects

AUTHOR

Martin Hasch, University of Ulm
Edited by: martin, last change: 1998/04/10, revision: 1.3, converted to HTML: 1998/04/10

Oberon || Library || Module Index || Search Engine || Definition || Module