Class PrivilegedRevealOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase5.PrivilegedRevealOrError
- All Implemented Interfaces:
Consumer<EK9Parser.ObjectAccessExpressionContext>
final class PrivilegedRevealOrError
extends TypedSymbolAccess
implements Consumer<EK9Parser.ObjectAccessExpressionContext>
Checks that reveal() on Sensitive is only called from within a class or trait that is Privileged.
Privilege is inherited (
isImplementingInSomeWay): the Privileged trait itself, a trait that has it
anywhere in its trait chain, or a super class that is Privileged.
Functions cannot call reveal() because functions cannot have traits.
This provides compile-time enforcement of capability-based access control for secret values.-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionPrivilegedRevealOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, Ek9Types ek9Types) -
Method Summary
Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
PrivilegedRevealOrError
PrivilegedRevealOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, Ek9Types ek9Types)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<EK9Parser.ObjectAccessExpressionContext>
-