Get a key
Reading or writing key definitions requires an admin key. |
Solution
Use the Get
function:
ObjectV(ref: RefV(id = "1", collection = RefV(id = "keys")),ts: LongV(1631659915870000),role: StringV(admin),hashed_secret: StringV($2a$05$5Z1aSUffhrS5cgUDweRGc.s5X/nBCXYX9Dczyb.uKIfvBgjsioAvG))
map[hashed_secret:$2a$05$qjmTLEkdvEvAMBILQOYvyuCCoRCfO7lt/VqVvC3Ga8vE9enuzbkXy ref:{1 0xc000200240 0xc000200240 <nil>} role:admin ts:1631660100530000]
{ref: ref(id = "1", collection = ref(id = "keys")), ts: 1631660385310000, role: "admin", hashed_secret: "$2a$05$4XsUiJsdsd6zLN8kJF7yru3bHUONLzoiq0MpYYSkTJCXn6As3ThaG"}
{
ref: Ref(Keys(), "1"),
ts: 1631658750650000,
role: 'admin',
hashed_secret: '$2a$05$Df1vv7hVWEJO0./ah1uMnOx6Jas0bAXr9BKzG8tvhFLfU6rotOxIG'
}
{'ref': Ref(id=1, collection=Ref(id=keys)), 'ts': 1631660773940000, 'role': 'admin', 'hashed_secret': '$2a$05$flBxAwoVCmMhazskpS3G1OqTc0da0Yf9FgH71r7Z4GmH1E4UbwXe6'}
{
ref: Ref(Keys(), "1"),
ts: 1630713320110000,
role: 'admin',
hashed_secret: '$2a$05$FZsfn143PoEKFTu/LsLJaOAL9cFsXRKfeRGb4r8UbGLN2.xO86.FG'
}
Discussion
Once a key has been created, its secret is only displayed at that time. Afterwards, it is no longer possible to retrieve the key’s secret. If you have lost the secret associated with a key, delete the key and create a new one.
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!