issueGrant method
Issues a credential. The token comes back once and cannot be read again — the Hub keeps only a hash of it.
Implementation
Future<IssuedGrant> issueGrant({
required String principal,
required Set<String> roles,
String note = '',
}) async => IssuedGrant.fromJson(
await _object(
await post('/grants', {
'principal': principal,
'roles': roles.toList(),
if (note.isNotEmpty) 'note': note,
}),
),
);