Skip to content

Commit

Permalink
update expected output of blobstore conf templating in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cjnosal committed Sep 4, 2019
1 parent db707c2 commit 069e135
Showing 1 changed file with 65 additions and 25 deletions.
90 changes: 65 additions & 25 deletions spec/blobstore.conf.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'nginx' => {
'enable_metrics_endpoint' => true
},
'secret' => 'mysecret',
'secret' => 'hmac_secret',
}
}
}
Expand All @@ -54,7 +54,7 @@
ssl_certificate /var/vcap/jobs/blobstore/config/server_tls_cert.pem;
ssl_certificate_key /var/vcap/jobs/blobstore/config/server_tls_private_key.pem;
location / {
location ~* ^/(?<object_id>[a-fA-F0-9][a-fA-F0-9]\\/.+) {
root /var/vcap/store/blobstore/store/;
dav_methods DELETE PUT;
Expand All @@ -69,8 +69,16 @@
}
}
location /internal {
internal;
alias /var/vcap/store/blobstore/store/;
dav_methods DELETE PUT;
create_full_put_path on;
}
location ~* ^/signed/(?<object_id>.+)$ {
if ( $request_method !~ ^(GET|PUT)$ ) {
if ( $request_method !~ ^(GET|PUT|HEAD)$ ) {
return 405;
}
Expand All @@ -87,10 +95,10 @@
secure_link_hmac_algorithm sha256;
if ($secure_link_hmac != "1") {
return 404;
return 403;
}
rewrite ^/signed/(.*)$ /$object_id;
rewrite ^/signed/(.*)$ /internal/$object_id;
}
Expand Down Expand Up @@ -127,7 +135,7 @@
'nginx' => {
'enable_metrics_endpoint' => false
},
'secret' => 'mysecret',
'secret' => 'hmac_secret',
}
}
}
Expand All @@ -154,7 +162,7 @@
ssl_certificate /var/vcap/jobs/blobstore/config/server_tls_cert.pem;
ssl_certificate_key /var/vcap/jobs/blobstore/config/server_tls_private_key.pem;
location / {
location ~* ^/(?<object_id>[a-fA-F0-9][a-fA-F0-9]\\/.+) {
root /var/vcap/store/blobstore/store/;
dav_methods DELETE PUT;
Expand All @@ -169,8 +177,16 @@
}
}
location /internal {
internal;
alias /var/vcap/store/blobstore/store/;
dav_methods DELETE PUT;
create_full_put_path on;
}
location ~* ^/signed/(?<object_id>.+)$ {
if ( $request_method !~ ^(GET|PUT)$ ) {
if ( $request_method !~ ^(GET|PUT|HEAD)$ ) {
return 405;
}
Expand All @@ -187,10 +203,10 @@
secure_link_hmac_algorithm sha256;
if ($secure_link_hmac != "1") {
return 404;
return 403;
}
rewrite ^/signed/(.*)$ /$object_id;
rewrite ^/signed/(.*)$ /internal/$object_id;
}
Expand Down Expand Up @@ -218,7 +234,7 @@
'nginx' => {
'enable_metrics_endpoint' => false
},
'secret' => 'mysecret',
'secret' => 'hmac_secret',
}
}
}
Expand All @@ -243,7 +259,7 @@
ssl_certificate /var/vcap/jobs/blobstore/config/server_tls_cert.pem;
ssl_certificate_key /var/vcap/jobs/blobstore/config/server_tls_private_key.pem;
location / {
location ~* ^/(?<object_id>[a-fA-F0-9][a-fA-F0-9]\\/.+) {
root /var/vcap/store/blobstore/store/;
dav_methods DELETE PUT;
Expand All @@ -258,8 +274,16 @@
}
}
location /internal {
internal;
alias /var/vcap/store/blobstore/store/;
dav_methods DELETE PUT;
create_full_put_path on;
}
location ~* ^/signed/(?<object_id>.+)$ {
if ( $request_method !~ ^(GET|PUT)$ ) {
if ( $request_method !~ ^(GET|PUT|HEAD)$ ) {
return 405;
}
Expand All @@ -276,10 +300,10 @@
secure_link_hmac_algorithm sha256;
if ($secure_link_hmac != "1") {
return 404;
return 403;
}
rewrite ^/signed/(.*)$ /$object_id;
rewrite ^/signed/(.*)$ /internal/$object_id;
}
Expand Down Expand Up @@ -307,7 +331,7 @@
'nginx' => {
'enable_metrics_endpoint' => false
},
'secret' => 'mysecret',
'secret' => 'hmac_secret',
}
}
}
Expand All @@ -334,7 +358,7 @@
ssl_certificate /var/vcap/jobs/blobstore/config/server_tls_cert.pem;
ssl_certificate_key /var/vcap/jobs/blobstore/config/server_tls_private_key.pem;
location / {
location ~* ^/(?<object_id>[a-fA-F0-9][a-fA-F0-9]\\/.+) {
root /var/vcap/store/blobstore/store/;
dav_methods DELETE PUT;
Expand All @@ -349,8 +373,16 @@
}
}
location /internal {
internal;
alias /var/vcap/store/blobstore/store/;
dav_methods DELETE PUT;
create_full_put_path on;
}
location ~* ^/signed/(?<object_id>.+)$ {
if ( $request_method !~ ^(GET|PUT)$ ) {
if ( $request_method !~ ^(GET|PUT|HEAD)$ ) {
return 405;
}
Expand All @@ -367,10 +399,10 @@
secure_link_hmac_algorithm sha256;
if ($secure_link_hmac != "1") {
return 404;
return 403;
}
rewrite ^/signed/(.*)$ /$object_id;
rewrite ^/signed/(.*)$ /internal/$object_id;
}
Expand Down Expand Up @@ -398,7 +430,7 @@
'nginx' => {
'enable_metrics_endpoint' => false
},
'secret' => 'mysecret',
'secret' => 'hmac_secret',
}
}
}
Expand All @@ -425,7 +457,7 @@
ssl_certificate /var/vcap/jobs/blobstore/config/server_tls_cert.pem;
ssl_certificate_key /var/vcap/jobs/blobstore/config/server_tls_private_key.pem;
location / {
location ~* ^/(?<object_id>[a-fA-F0-9][a-fA-F0-9]\\/.+) {
root /var/vcap/store/blobstore/store/;
dav_methods DELETE PUT;
Expand All @@ -440,8 +472,16 @@
}
}
location /internal {
internal;
alias /var/vcap/store/blobstore/store/;
dav_methods DELETE PUT;
create_full_put_path on;
}
location ~* ^/signed/(?<object_id>.+)$ {
if ( $request_method !~ ^(GET|PUT)$ ) {
if ( $request_method !~ ^(GET|PUT|HEAD)$ ) {
return 405;
}
Expand All @@ -458,10 +498,10 @@
secure_link_hmac_algorithm sha256;
if ($secure_link_hmac != "1") {
return 404;
return 403;
}
rewrite ^/signed/(.*)$ /$object_id;
rewrite ^/signed/(.*)$ /internal/$object_id;
}
Expand Down

0 comments on commit 069e135

Please sign in to comment.