Make invites use store (#92)

This commit is contained in:
Asim Aslam
2021-05-03 14:36:29 +01:00
committed by GitHub
parent 72b7436805
commit 6fda0401ef
9 changed files with 308 additions and 211 deletions

View File

@@ -25,3 +25,13 @@ func FromAccount(acc *auth.Account) string {
}
return fmt.Sprintf("%s/%s", acc.Issuer, owner)
}
// CreateKey generated a unique key for a resource
func CreateKey(ctx context.Context, key string) string {
t, ok := FromContext(ctx)
if !ok {
return key
}
// return a tenant prefixed key e.g micro/asim/foobar
return fmt.Sprintf("%s/%s", t, key)
}