diff --git a/src/main/java/com/clevercloud/biscuit/datalog/Scope.java b/src/main/java/com/clevercloud/biscuit/datalog/Scope.java index 6a9e045c..0658bfde 100644 --- a/src/main/java/com/clevercloud/biscuit/datalog/Scope.java +++ b/src/main/java/com/clevercloud/biscuit/datalog/Scope.java @@ -75,4 +75,12 @@ static public Either deserialize(Schema.Scope scope) { } return Left(new Error.FormatError.DeserializationError("invalid Scope")); } + + @Override + public String toString() { + return "Scope{" + + "kind=" + kind + + ", publicKey=" + publicKey + + '}'; + } } diff --git a/src/main/java/com/clevercloud/biscuit/datalog/SymbolTable.java b/src/main/java/com/clevercloud/biscuit/datalog/SymbolTable.java index b8800f50..6bdeef92 100644 --- a/src/main/java/com/clevercloud/biscuit/datalog/SymbolTable.java +++ b/src/main/java/com/clevercloud/biscuit/datalog/SymbolTable.java @@ -61,7 +61,7 @@ private String fromEpochIsoDate(long epochSec) { "query" ); public final List symbols; - public final List publicKeys; + private final List publicKeys; public long insert(final String symbol) { int index = this.defaultSymbols.indexOf(symbol); @@ -81,6 +81,13 @@ public long insert(final String symbol) { public int currentOffset() { return this.symbols.size(); } + public int currentPublicKeyOffset() { + return this.publicKeys.size(); + } + + public List publicKeys() { + return publicKeys; + } public long insert(final PublicKey publicKey) { int index = this.publicKeys.indexOf(publicKey); @@ -280,9 +287,9 @@ public SymbolTable(SymbolTable s) { public SymbolTable(List symbols, List publicKeys) { this.symbols = new ArrayList<>(); - symbols.addAll(symbols); + this.symbols.addAll(symbols); this.publicKeys = new ArrayList<>(); - publicKeys.addAll(publicKeys); + this.publicKeys.addAll(publicKeys); } public List getAllSymbols() { diff --git a/src/main/java/com/clevercloud/biscuit/datalog/TrustedOrigins.java b/src/main/java/com/clevercloud/biscuit/datalog/TrustedOrigins.java index eea8b2d5..8d1d14f2 100644 --- a/src/main/java/com/clevercloud/biscuit/datalog/TrustedOrigins.java +++ b/src/main/java/com/clevercloud/biscuit/datalog/TrustedOrigins.java @@ -77,4 +77,11 @@ public static TrustedOrigins fromScopes(List ruleScopes, public boolean contains(Origin factOrigin) { return this.inner.inner.containsAll(factOrigin.inner); } + + @Override + public String toString() { + return "TrustedOrigins{" + + "inner=" + inner + + '}'; + } }