Skip to content
Back

Delete $updatedAt attribute

  • 0
  • Databases
  • Cloud
zombikaa
17 Nov, 2024, 10:59

Hi! Is there a way to make the $updatedAt attribute private or deleted? I don't want users to see when were the documents updated in a collection.

TL;DR
Developers discuss deleting the $updatedAt attribute and securing API keys on Appwrite. Generating dynamic API keys is recommended for better security. To restrict access, permissions can be assigned at the function level. Using Query.select or .map functionality can help in controlling attributes passed.
joe_2512 <-- UBI
15 Dec, 2024, 04:14

create a new object with all the atributs except of this

joe_2512 <-- UBI
15 Dec, 2024, 04:14

@zombikaa

joe_2512 <-- UBI
15 Dec, 2024, 04:14

you can use the .map functionality

joe_2512 <-- UBI
15 Dec, 2024, 04:15

but in general i don't know why you even give them access to the whole document object... why would they ever see this attribute?

zombikaa
15 Dec, 2024, 07:33

I made it with a function

zombikaa
15 Dec, 2024, 07:34

But thanks!

Guille
16 Dec, 2024, 04:48

You can use Query.select as well, in that case you only pass the attributes you want

zombikaa
16 Dec, 2024, 10:44

Yeah but the problem with that was that anyone can make their own code and get that attribute

Guille
16 Dec, 2024, 10:46

Yeah, you're right your best and secure option is a function

zombikaa
16 Dec, 2024, 10:46

The thing i dont understand is that can anyone make a function to my project if they give my project id?

Guille
16 Dec, 2024, 10:50

You can assign execution permissions, if you allow permission to all users, any user logged in will be able to execute your function

zombikaa
16 Dec, 2024, 10:50

But not executing, making their own functions

Guille
16 Dec, 2024, 10:58

No, they will need an API key to do that, the API key must be associated with your project

zombikaa
16 Dec, 2024, 11:16

I have a dynamic key

zombikaa
16 Dec, 2024, 11:16

Cant they just request it from header too

Guille
16 Dec, 2024, 11:58

Check this blog post: https://appwrite.io/blog/post/how-to-leverage-dynamic-api-keys-for-better-security

Dynamic API keys are short-lived API keys that Appwrite automatically generates for each function execution. These keys are unique to each function run and have specific scopes which enhances security by reducing their lifespan and exposure. In contrast, long-lived keys pose a higher risk if compromised.

If they generate an API key from their function, it won't work as each key is associated to a function and project

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more