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

Task: validate CUSTOMERS file before use #391

Open
alexellis opened this Issue Feb 6, 2019 · 6 comments

Comments

Projects
None yet
2 participants
@alexellis
Copy link
Member

alexellis commented Feb 6, 2019

Expected Behaviour

We should validate all entries in the CUSTOMERS file before use - to prevent anyone getting their functions overriden by accident. See issue #314

Possible Solution

Since this is relying on a human element of not merging a PR to the customers file with two potentially clashing usernames, we should implement a unit test and sdk method in the sdk of OpenFaaS Cloud that can validate a list of usernames.

I.e.

OK

alexellis
stefan
ivana

Not OK

alexellis
alexellis-suffix
stefan
ivana

Not OK

alexellis
stefan
stefan-prodan
ivana

OK

alexellis
stefan-prodan
ivana
@alexellis

This comment has been minimized.

Copy link
Member Author

alexellis commented Feb 6, 2019

@alexellis

This comment has been minimized.

Copy link
Member Author

alexellis commented Feb 6, 2019

No need to test end-to-end, just via unit tests.

https://blog.alexellis.io/golang-writing-unit-tests/

@rajatjindal

This comment has been minimized.

Copy link
Contributor

rajatjindal commented Feb 6, 2019

how about

alexellis   
stefan-prodan  
stefan  
ivana

and

alexellis
alexe
stefan
ivana
@alexellis

This comment has been minimized.

Copy link
Member Author

alexellis commented Feb 6, 2019

What about it?

@alexellis

This comment has been minimized.

Copy link
Member Author

alexellis commented Feb 6, 2019

alexe won't clash because of the separator being -

@alexellis

This comment has been minimized.

Copy link
Member Author

alexellis commented Feb 6, 2019

alexe => alexe-my-function
alexellis => alexellis-my-function

@viveksyngh viveksyngh referenced this issue Feb 6, 2019

Merged

Add validation customer names list #393

2 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment