Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
perkinsjr opened this issue Jan 8, 2024 · 16 comments
Labels
API Unkey API related Dashboard Unkey dashboard related Improvement Improve an existing feature

Comments

@perkinsjr
Copy link
Collaborator

perkinsjr commented Jan 8, 2024

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.

@perkinsjr perkinsjr added API Unkey API related Dashboard Unkey dashboard related Improvement Improve an existing feature labels Jan 8, 2024
Copy link

linear bot commented Jan 8, 2024

@perkinsjr perkinsjr changed the title Provide a warning when a Workspace creates an API with the same name Provide a warning when a user in a Workspace creates an API with the same name Jan 8, 2024
@dhawalpatil200
Copy link

Hey,
Can I take this issue ?

@perkinsjr
Copy link
Collaborator Author

Sure @dhawalpatil200 assigning to you now.

@dhawalpatil200
Copy link

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
Copy link
Collaborator Author

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
Copy link

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
Copy link
Collaborator Author

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

@dhawalpatil200
Copy link

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

Error: VT10001: foreign key constraints are not allowed

@chronark
Copy link
Collaborator

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

@dhawalpatil200
Copy link

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
Copy link
Collaborator

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
Copy link

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
Copy link
Collaborator

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

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

@dhawalpatil200
Copy link

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
Copy link
Collaborator

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

@dhawalpatil200
Copy link

You can review PR now. Required changes are present now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Unkey API related Dashboard Unkey dashboard related Improvement Improve an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants