Merge changes I197d08eb,I659576af into main

* changes:
  Use a struct for key access information
  tests: refactor grant tests