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

[#153072577] First steps to admin app: Base rails app with OAuth #1

Merged
merged 40 commits into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
559d794
rails new
Dec 4, 2017
ee66fb9
Create LICENSE
Dec 4, 2017
b611a66
Remove coffee-rails
camelpunch Dec 4, 2017
6e3d343
Set Ruby version to 2.4.2
camelpunch Dec 4, 2017
13d56e9
CF manifest
camelpunch Dec 4, 2017
0bf1c4a
add ./bin to PATH for direnv users
camelpunch Dec 4, 2017
dfda3e6
Set up / to always redirect to OAUTH_REDIRECT_URL
camelpunch Dec 5, 2017
776877a
clean Gemfile of comments
camelpunch Dec 5, 2017
800b7f6
Remove some gems we don't yet need
camelpunch Dec 5, 2017
714612e
Use omniauth to redirect to UAA
camelpunch Dec 5, 2017
4724cc7
Handle response from UAA, display token.
camelpunch Dec 5, 2017
15c443b
Move before_action to application controller
camelpunch Dec 5, 2017
6f2936a
Tidy up omniauth stuff after spec examples
camelpunch Dec 5, 2017
b7757fc
Switch to capybara
camelpunch Dec 5, 2017
5f15b63
use latest omniauth-uaa-oauth2
camelpunch Dec 5, 2017
709c020
Tidy feature spec
camelpunch Dec 5, 2017
d0c6896
Begin sketching a CF client interface
camelpunch Dec 6, 2017
cfa8756
Fix bundler binstub
camelpunch Dec 6, 2017
7b59785
Skip OmniAuth UAA TLS validation from ENV in dev
camelpunch Dec 6, 2017
222a005
Add Faraday, an HTTP client
camelpunch Dec 6, 2017
231b99e
Use gds-way .editorconfig
Dec 6, 2017
8880207
Construction duck
Dec 7, 2017
4134ee1
Implement basic CF Client for testing token
camelpunch Dec 6, 2017
2e0679b
Ensure token has not expired
henrytk Dec 7, 2017
ef885ec
Rename environment variables for consistancy with other paas-things
Dec 7, 2017
1b2cc9c
skip integration tests unless CONTRACT_TEST_TOKEN
Dec 7, 2017
2858637
README and helper scripts
Dec 7, 2017
0cb2c11
Add instructions for running locally
henrytk Dec 8, 2017
2ec41d5
add travis.yml
Dec 8, 2017
eff6e3f
Add/configure rubocop
Dec 11, 2017
b52b35f
Rename Rails.configuration.api_endpoint
Dec 11, 2017
db43048
Enable recormended RSpec defaults
Dec 11, 2017
a6976df
Rubocop corrections
Dec 11, 2017
216d3a1
Enable Rubocop in Travis
Dec 12, 2017
2c0437d
"design mode" RAILS_ENV=design
Dec 12, 2017
02bda56
Ignore vendor dir
Dec 12, 2017
3e5e30b
Favour documentation over scripts/envrc magic
Dec 12, 2017
247d5d5
Optional CF_* env variables for unit tests
Dec 12, 2017
0fa2101
Inherit rubocop config from govuk-lint
Dec 14, 2017
6d68e91
Rubocop fixes after enabling rspec cops.
Dec 14, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
113 changes: 113 additions & 0 deletions .editorconfig
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 =
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export PATH="./bin:$PATH"
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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 vendor
vendor

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

/node_modules
/yarn-error.log

.byebug_history

# RSpec state
spec/examples.txt
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
35 changes: 35 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
require: rubocop-rspec
inherit_gem:
govuk-lint:
- configs/rubocop/all.yml
AllCops:
Include:
- '**/Rakefile'
- '**/config.ru'
Exclude:
- 'bin/*'
- 'vendor/**/*'
TargetRubyVersion: 2.4.2
Metrics/BlockLength:
Enabled: true
Exclude:
- "test/**/*"
- "**/spec/**/*"
- "config/**/*"
Rails:
Enabled: true
RSpec/MultipleExpectations:
Description: Checks if examples contain far too many `expect` calls.
Enabled: true
Max: 20
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleExpectations
RSpec/ExampleLength:
Description: Checks for excessively long examples.
Enabled: true
Max: 30
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleLength
RSpec/VerifiedDoubles:
Description: Prefer using verifying doubles over normal doubles.
Enabled: false
IgnoreSymbolicNames: false
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VerifiedDoubles
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.4.2
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: ruby
rvm:
- 2.4.2

env:
global:
- CF_API_ENDPOINT=none
- CF_AUTH_ENDPOINT=none
- CF_TOKEN_ENDPOINT=none
- CF_CLIENT_ID=none
- CF_CLIENT_SECRET=none

script:
- ./bin/rspec
- ./bin/rubocop

32 changes: 32 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
source "https://rubygems.org"

ruby "2.4.2"

git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end

gem "faraday"
gem "omniauth-uaa-oauth2", github: "cloudfoundry/omniauth-uaa-oauth2"
gem "puma", "~> 3.7"
gem "rails", "~> 5.1.4"
gem "uglifier", ">= 1.3.0"

group :development, :test do
gem "capybara"
gem "pry-byebug"
gem "rack_session_access"
gem "rspec-rails"
end

group :development do
gem "govuk-lint", "~> 3.4.0"
gem "listen", ">= 3.0.5", "< 3.2"
gem "rubocop", "~> 0.51.0", require: false
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "web-console", ">= 3.3.0"
end

gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]
Loading