unkeyed / unkey

Open source API management platform
https://go.unkey.com
Other
4k stars 467 forks source link

Provide a warning when a user in a Workspace creates an API with the same name #773

Closed perkinsjr closed 3 months ago

perkinsjr commented 9 months ago

Our API name field for both creation and updating doesn't warn the user that they have a API with the same name.

We only need to enforce this in the workspace they are currently in. We don't need to enforce uniqueness because

  1. It's not user facing
  2. It's just use to group keys
  3. It's updatable if you happen to click through a warning and get there.

This needs to be implemented the UI.

linear[bot] commented 9 months ago

ENG-380 Provide a warning when a Workspace creates an API with the same name

dhawalpatil200 commented 9 months ago

Hey, Can I take this issue ?

perkinsjr commented 9 months ago

Sure @dhawalpatil200 assigning to you now.

dhawalpatil200 commented 9 months ago

Do we have to provide warning to user in form of Snackbar/Toast OR in any other way before creating API with already existing name ?

perkinsjr commented 9 months ago

This is exactly what this issue is.

We have Ui components either alert / toast you can find all of them here.

apps/web/components/ui

dhawalpatil200 commented 9 months ago

Heyy, I'm doing local setup In documentation doesn't understand where to edit this variable. Could you please help me with this? Also I don't understand what is value of host here DRIZZLE_DATABASE_URL='mysql://{user}:{password}@{host}/unkey?ssl={"rejectUnauthorized":true}'

perkinsjr commented 9 months ago

Host would be the planetscale URL for example aws.connect.psdb.cloud

dhawalpatil200 commented 9 months ago

I have followed the steps to setup Drizzle schema. I'm getting following error

Error: VT10001: foreign key constraints are not allowed

chronark commented 9 months ago

oh good catch, you need to enable foreign keys in your db CleanShot 2024-01-10 at 16 59 30@2x

dhawalpatil200 commented 9 months ago

Heyyy, export TENANT_ID={clerk org id from previous step} I'm not able to understant this clerk org id Could you please describe it briefly about org id and what value should go in TENANT_ID ?

Also pnpm bootstrap is not working Its giving error :  ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command "bootstrap" not found

chronark commented 9 months ago

CleanShot 2024-01-10 at 18 06 54@2x You can use your user id from clerk, or create an organisation and use it's id (=orgId)

double check if you're in the root, cause that script definitely exists :)

dhawalpatil200 commented 9 months ago

In getting started guide it is stated that, UNKEY_KEY_AUTH_ID (which is generated after pnpm bootstrap) should be pasted in apps/agent/.env But there is no agent directory in apps. Is this any documentation issue or I'm interpreting it wrong.

chronark commented 9 months ago

should be apps/api/.dev.vars I'll fix it

this is only necessary if you plan to work on the API though.

dhawalpatil200 commented 9 months ago

Heyy, I have created api name with 'test' and then again tried to create api with same name it displayed following result. Let me know whether is it good or anything extra can be done.

Screenshot 2024-01-12 at 7 15 13 PM
chronark commented 9 months ago

Looks good, maybe I'm missing something but the PR does not seem to reflect that yet?

dhawalpatil200 commented 9 months ago

You can review PR now. Required changes are present now