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

Development #26

Merged
merged 42 commits into from
Oct 21, 2019
Merged

Development #26

merged 42 commits into from
Oct 21, 2019

Conversation

gmarupilla
Copy link
Contributor

I added client id and domain to config and kept it in gitignore. I've added config.example.json which the user can copy paste as config.json and modify the contents for testing purposes. Or environment wise.

@bilalshaikh42
Copy link
Member

The build and docker tests are failing. Could you make sure that the app builds properly outside your local environment?
@gmarupilla

@gmarupilla
Copy link
Contributor Author

I've added config.example.json as a default config.. Or a template config..every time we want to build it.. We will copy example config to config.json
And then it'll work. It's a replacement for environment variable. Since in front-end app we cannot access environment variables

@bilalshaikh42
Copy link
Member

I've added config.example.json as a default config.. Or a template config..every time we want to build it.. We will copy example config to config.json
And then it'll work. It's a replacement for environment variable. Since in front-end app we cannot access environment variables

I see that the config file contains just the Auth0 client id. In that case, it does not need to be hidden and should be included in the source to allow for automatic building and deployment

https://community.auth0.com/t/client-id-vs-secret/9558

@gmarupilla
Copy link
Contributor Author

I've added config.example.json as a default config.. Or a template config..every time we want to build it.. We will copy example config to config.json
And then it'll work. It's a replacement for environment variable. Since in front-end app we cannot access environment variables

I see that the config file contains just the Auth0 client id. In that case, it does not need to be hidden and should be included in the source to allow for automatic building and deployment

https://community.auth0.com/t/client-id-vs-secret/9558

Still, I think it's better to have such things in a configuration file rather than being hardcoded into code itself. Here's one use case why, I have my own personal auth0 account which I use to experiment/test the code that I write, if I modify client id in code, I'll need to exempt it from commits every single time I change anything else. With a configuration file like this, user can modify configuration with ease according to different environments. To resolve this, I added docker rule to copy config.example.json (which is default config for heroku) to config.json. Moreover, more things are also added to config, and will keep on increasing in the future.

@bilalshaikh42
Copy link
Member

I've added config.example.json as a default config.. Or a template config..every time we want to build it.. We will copy example config to config.json
And then it'll work. It's a replacement for environment variable. Since in front-end app we cannot access environment variables

I see that the config file contains just the Auth0 client id. In that case, it does not need to be hidden and should be included in the source to allow for automatic building and deployment
https://community.auth0.com/t/client-id-vs-secret/9558

Still, I think it's better to have such things in a configuration file rather than being hardcoded into code itself. Here's one use case why, I have my own personal auth0 account which I use to experiment/test the code that I write, if I modify client id in code, I'll need to exempt it from commits every single time I change anything else. With a configuration file like this, user can modify configuration with ease according to different environments. To resolve this, I added docker rule to copy config.example.json (which is default config for heroku) to config.json. Moreover, more things are also added to config, and will keep on increasing in the future.

Got it. In that case, lets make use of the environment.ts and environment.prod.ts files in the environments folder. The auth service has a good example on how I used the files to change based on various environments. You could even add a new environment for your development environment. Thi way, everything needed to build the app (currently the build step is failing in the node workflow) is present in default configurations at all times. When building, use the --configuration flag
Here is a good guide for it:
Link

@gmarupilla
Copy link
Contributor Author

I've added config.example.json as a default config.. Or a template config..every time we want to build it.. We will copy example config to config.json
And then it'll work. It's a replacement for environment variable. Since in front-end app we cannot access environment variables

I see that the config file contains just the Auth0 client id. In that case, it does not need to be hidden and should be included in the source to allow for automatic building and deployment
https://community.auth0.com/t/client-id-vs-secret/9558

Still, I think it's better to have such things in a configuration file rather than being hardcoded into code itself. Here's one use case why, I have my own personal auth0 account which I use to experiment/test the code that I write, if I modify client id in code, I'll need to exempt it from commits every single time I change anything else. With a configuration file like this, user can modify configuration with ease according to different environments. To resolve this, I added docker rule to copy config.example.json (which is default config for heroku) to config.json. Moreover, more things are also added to config, and will keep on increasing in the future.

Got it. In that case, lets make use of the environment.ts and environment.prod.ts files in the environments folder. The auth service has a good example on how I used the files to change based on various environments. You could even add a new environment for your development environment. Thi way, everything needed to build the app (currently the build step is failing in the node workflow) is present in default configurations at all times. When building, use the --configuration flag
Here is a good guide for it:
Link

Thanks for the info, moved configs to environment files.

@gmarupilla
Copy link
Contributor Author

gmarupilla commented Oct 15, 2019

I guess tests are failing in the components you've written. Can you look into it? @bilalshaikh42

@bilalshaikh42
Copy link
Member

Yup tests are not yet passing per #9 . For now we can only assume it works if building. I'll merge this in

CRBM-Viz/angular.json Show resolved Hide resolved
CRBM-Viz/src/app/Services/auth0.service.ts Outdated Show resolved Hide resolved
CRBM-Viz/src/app/Services/auth0.service.ts Outdated Show resolved Hide resolved
CRBM-Viz/src/app/Services/auth0.service.ts Outdated Show resolved Hide resolved
@todo
Copy link

todo bot commented Oct 21, 2019

@bilalshaikh42 bilalshaikh42 merged commit 983db07 into master Oct 21, 2019
@todo todo bot mentioned this pull request Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants