Skip to content

Commit

Permalink
Make default symbol table conform to the spec
Browse files Browse the repository at this point in the history
  • Loading branch information
divarvel authored and KannarFr committed Mar 22, 2022
1 parent 8fd22e3 commit 1d7e571
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/java/com/clevercloud/biscuit/token/Biscuit.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,25 @@ public String print() {
public Biscuit copy() throws Error {
return Biscuit.from_serialize_biscuit(this.serializedBiscuit, this.symbols);
}

/**
* Default symbols list
*/
static public SymbolTable default_symbol_table() {
SymbolTable syms = new SymbolTable();
syms.insert("read");
syms.insert("write");
syms.insert("resource");
syms.insert("operation");
syms.insert("right");
syms.insert("time");
syms.insert("role");

return syms;
}

@Override
protected Object clone() throws CloneNotSupportedException {
return super.clone();
}
}

0 comments on commit 1d7e571

Please sign in to comment.