-
Notifications
You must be signed in to change notification settings - Fork 9
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
[#153072577] First steps to admin app: Base rails app with OAuth #1
Merged
Merged
Changes from 30 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
559d794
rails new
ee66fb9
Create LICENSE
b611a66
Remove coffee-rails
camelpunch 6e3d343
Set Ruby version to 2.4.2
camelpunch 13d56e9
CF manifest
camelpunch 0bf1c4a
add ./bin to PATH for direnv users
camelpunch dfda3e6
Set up / to always redirect to OAUTH_REDIRECT_URL
camelpunch 776877a
clean Gemfile of comments
camelpunch 800b7f6
Remove some gems we don't yet need
camelpunch 714612e
Use omniauth to redirect to UAA
camelpunch 4724cc7
Handle response from UAA, display token.
camelpunch 15c443b
Move before_action to application controller
camelpunch 6f2936a
Tidy up omniauth stuff after spec examples
camelpunch b7757fc
Switch to capybara
camelpunch 5f15b63
use latest omniauth-uaa-oauth2
camelpunch 709c020
Tidy feature spec
camelpunch d0c6896
Begin sketching a CF client interface
camelpunch cfa8756
Fix bundler binstub
camelpunch 7b59785
Skip OmniAuth UAA TLS validation from ENV in dev
camelpunch 222a005
Add Faraday, an HTTP client
camelpunch 231b99e
Use gds-way .editorconfig
8880207
Construction duck
4134ee1
Implement basic CF Client for testing token
camelpunch 2e0679b
Ensure token has not expired
henrytk ef885ec
Rename environment variables for consistancy with other paas-things
1b2cc9c
skip integration tests unless CONTRACT_TEST_TOKEN
2858637
README and helper scripts
0cb2c11
Add instructions for running locally
henrytk 2ec41d5
add travis.yml
eff6e3f
Add/configure rubocop
b52b35f
Rename Rails.configuration.api_endpoint
db43048
Enable recormended RSpec defaults
a6976df
Rubocop corrections
216d3a1
Enable Rubocop in Travis
2c0437d
"design mode" RAILS_ENV=design
02bda56
Ignore vendor dir
3e5e30b
Favour documentation over scripts/envrc magic
247d5d5
Optional CF_* env variables for unit tests
0fa2101
Inherit rubocop config from govuk-lint
6d68e91
Rubocop fixes after enabling rspec cops.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# http://EditorConfig.org | ||
# https://gds-way.cloudapps.digital/manuals/programming-languages/editorconfig | ||
# Copy into project root and rename to .editorconfig | ||
|
||
# uncomment if top-most EditorConfig file | ||
# root = true | ||
|
||
[*.java] | ||
indent_size = 4 | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = false | ||
continuation_indent_size = 8 | ||
|
||
[*.scss] | ||
indent_size = 2 | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.erb] | ||
indent_size = 2 | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.html] | ||
indent_size = 2 | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.css] | ||
indent_size = 2 | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.js] | ||
indent_size = 2 | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.json] | ||
indent_size = 2 | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.py] | ||
indent_size = 4 | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
max_line_length = 119 | ||
|
||
[*.rb] | ||
indent_size = 2 | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.sh] | ||
indent_size = 2 | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.yml] | ||
indent_size = 2 | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[Makefile] | ||
indent_size = 2 | ||
indent_style = tab | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[**vendor**] | ||
indent_size = | ||
indent_style = | ||
charset = | ||
end_of_line = | ||
insert_final_newline = | ||
trim_trailing_whitespace = | ||
max_line_length = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export PATH="./bin:$PATH" | ||
export CF_API_ENDPOINT="https://api.${DEPLOY_ENV}.dev.cloudpipeline.digital" | ||
export CF_AUTH_ENDPOINT=$(cf curl /v2/info | jq -r .authorization_endpoint) | ||
export CF_TOKEN_ENDPOINT=$(cf curl /v2/info | jq -r .token_endpoint) | ||
export CF_CLIENT_ID="paas-admin" | ||
export CF_CLIENT_SECRET=$(aws s3 cp s3://gds-paas-${DEPLOY_ENV}-state/cf-secrets.yml - | awk '/uaa_clients_paas_admin_secret/ { print $2 }') | ||
export SKIP_TLS_VERIFICATION="true" | ||
export CONTRACT_TEST_TOKEN=$(cf oauth-token | cut -d ' ' -f2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# See https://help.github.com/articles/ignoring-files for more about ignoring files. | ||
# | ||
# If you find yourself ignoring temporary files generated by your text editor | ||
# or operating system, you probably want to add a global ignore instead: | ||
# git config --global core.excludesfile '~/.gitignore_global' | ||
|
||
# Ignore bundler config. | ||
/.bundle | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/* | ||
/tmp/* | ||
!/log/.keep | ||
!/tmp/.keep | ||
|
||
/node_modules | ||
/yarn-error.log | ||
|
||
.byebug_history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--require spec_helper |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include things that are so specific to our development environments? Do we want other people to use the app in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have mixed feelings.
Setting up these variables for running in dev is painful. But I understand this is so specific to us that would be annoying for outsiders.
Henry created some scripts for running (to replace/augment .envrc) ... maybe we should document the "standard" way ie
CF_AUTH_ENDPOINT=xx CF_TOKEN_ENDPOINT=yy rails s
in the README for all to enjoy ... but then have some additional documentation for paas-specific-ness?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good. I definitely appreciated having an easy way to run it against my dev environment, but I think it would be easier to understand if we provided generic instructions foremost.