openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject [incubator-openwhisk-apigateway] branch master updated: Support ASF Header in .md and .sh files for scancode (#292)
Date Tue, 01 May 2018 17:50:30 GMT
This is an automated email from the ASF dual-hosted git repository.

pdesai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-apigateway.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c4b804  Support ASF Header in .md and .sh files for scancode (#292)
5c4b804 is described below

commit 5c4b80430a371f1a0ca107f9477b37e800989384
Author: Matt Rutkowski <mrutkows@us.ibm.com>
AuthorDate: Tue May 1 12:50:28 2018 -0500

    Support ASF Header in .md and .sh files for scancode (#292)
    
    * Fix EOL issues in .md files.
    
    * Fix missing ASF License, EOL issues in .sh files.
---
 CONTRIBUTING.md                   | 23 ++++++++++++-----------
 README.md                         |  4 ++--
 build_config_supervisor.sh        | 38 ++++++++++++++++++++++++++++----------
 build_profiling.sh                | 20 ++++++++++----------
 doc/v1/management_interface_v1.md |  4 ++--
 doc/v1/policies.md                | 20 ++++++++++----------
 doc/v1/security.md                | 14 +++++++-------
 doc/v2/management_interface_v2.md | 26 +++++++++++++-------------
 init.sh                           |  2 +-
 tests/install-deps.sh             |  2 +-
 tests/run-tests.sh                |  2 +-
 11 files changed, 87 insertions(+), 68 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index fcb1d0e..c58134e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,22 +1,23 @@
-[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
 <!--
 #
-# Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-# license agreements.  See the NOTICE file distributed with this work for additional 
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE file distributed with this work for additional
 # information regarding copyright ownership.  The ASF licenses this file to you
-# under the Apache License, Version 2.0 (the # "License"); you may not use this 
-# file except in compliance with the License.  You may obtain a copy of the License 
+# under the Apache License, Version 2.0 (the # "License"); you may not use this
+# file except in compliance with the License.  You may obtain a copy of the License
 # at:
 #
 # http://www.apache.org/licenses/LICENSE-2.0
 #
-# Unless required by applicable law or agreed to in writing, software distributed 
-# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
+# Unless required by applicable law or agreed to in writing, software distributed
+# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 # CONDITIONS OF ANY KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations under the License.
 #
 -->
 
+[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
+
 # Contributing to Apache OpenWhisk
 
 Anyone can contribute to the OpenWhisk project and we welcome your contributions.
@@ -36,18 +37,18 @@ Instructions on how to do this can be found here:
 [http://www.apache.org/licenses/#clas](http://www.apache.org/licenses/#clas)
 
 Once submitted, you will receive a confirmation email from the Apache Software Foundation
(ASF) and be added to
-the following list: http://people.apache.org/unlistedclas.html. 
+the following list: http://people.apache.org/unlistedclas.html.
 
 Project committers will use this list to verify pull requests (PRs) come from contributors
that have signed a CLA.
 
-We look forward to your contributions! 
+We look forward to your contributions!
 
 ## Raising issues
 
-Please raise any bug reports on the respective project repository's GitHub issue tracker.
Be sure to search the 
+Please raise any bug reports on the respective project repository's GitHub issue tracker.
Be sure to search the
 list to see if your issue has already been raised.
 
-A good bug report is one that make it easy for us to understand what you were trying to do
and what went wrong. 
+A good bug report is one that make it easy for us to understand what you were trying to do
and what went wrong.
 Provide as much context as possible so we can try to recreate the issue.
 
 ### Discussion
diff --git a/README.md b/README.md
index 576db0a..bd0e3ea 100644
--- a/README.md
+++ b/README.md
@@ -67,9 +67,9 @@ Syncing is done through [rclone sync](https://rclone.org/commands/rclone_sync/).
 
 ```
 docker run -ti --rm --entrypoint=rclone -v `pwd`/rclone/:/root/.config/rclone/ openwhisk/apigateway
config
-```  
+```
 
-This runs an interactive `rclone config` command and stores the resulted configuration in
`./rclone/rclone.conf` file.  
+This runs an interactive `rclone config` command and stores the resulted configuration in
`./rclone/rclone.conf` file.
 
 To test this locally, _simulate_ a remote folder using a local location, by mounting it in
`/tmp` folder as follows:
 
diff --git a/build_config_supervisor.sh b/build_config_supervisor.sh
index eccb7bf..6bb01d2 100644
--- a/build_config_supervisor.sh
+++ b/build_config_supervisor.sh
@@ -1,12 +1,30 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 #ENV CONFIG_SUPERVISOR_VERSION 1.0.1-RC1
 export GOPATH=/usr/lib/go/bin
 export GOBIN=/usr/lib/go/bin
 export PATH=$PATH:/usr/lib/go/bin
 echo " ... installing api-gateway-config-supervisor  ... " \
-apk update 
-apk add gcc make git go 
-mkdir -p /tmp/api-gateway 
-curl -k -L https://github.com/adobe-apiplatform/api-gateway-config-supervisor/archive/${CONFIG_SUPERVISOR_VERSION}.tar.gz
-o /tmp/api-gateway/api-gateway-config-supervisor-${CONFIG_SUPERVISOR_VERSION}.tar.gz 
+apk update
+apk add gcc make git go
+mkdir -p /tmp/api-gateway
+curl -k -L https://github.com/adobe-apiplatform/api-gateway-config-supervisor/archive/${CONFIG_SUPERVISOR_VERSION}.tar.gz
-o /tmp/api-gateway/api-gateway-config-supervisor-${CONFIG_SUPERVISOR_VERSION}.tar.gz
 cd /tmp/api-gateway
 tar -xf /tmp/api-gateway/api-gateway-config-supervisor-${CONFIG_SUPERVISOR_VERSION}.tar.gz
 mkdir -p /tmp/go
@@ -20,21 +38,21 @@ ln -s /tmp/go /tmp/go-src/src/github.com/adobe-apiplatform/api-gateway-config-su
 GOPATH=/tmp/go/vendor:/tmp/go-src CGO_ENABLED=0 GOOS=linux /usr/lib/go/bin/godep  go build
-ldflags "-s" -a -installsuffix cgo -o api-gateway-config-supervisor ./
 mv /tmp/go/api-gateway-config-supervisor /usr/local/sbin/
 
-echo "installing rclone sync ... " 
+echo "installing rclone sync ... "
 go get github.com/ncw/rclone
-mv /usr/lib/go/bin/rclone /usr/local/sbin/ 
+mv /usr/lib/go/bin/rclone /usr/local/sbin/
 mkdir -p /root/.config/rclone/
 cat <<EOF > /root/.config/rclone/rclone.conf
-[local] 
-type = local 
+[local]
+type = local
 nounc = true
 EOF
 
-echo " cleaning up ... " 
+echo " cleaning up ... "
 rm -rf /usr/lib/go/bin/src
 rm -rf /tmp/go
 rm -rf /tmp/go-src
 rm -rf /usr/lib/go/bin/pkg/
 rm -rf /usr/lib/go/bin/godep
 apk del make git go gcc
-rm -rf /var/cache/apk/*
\ No newline at end of file
+rm -rf /var/cache/apk/*
diff --git a/build_profiling.sh b/build_profiling.sh
index be771a7..088f18d 100755
--- a/build_profiling.sh
+++ b/build_profiling.sh
@@ -19,24 +19,24 @@
 cp Dockerfile Dockerfile.profiling
 
 sed -i -e 's/FROM\ alpine.*//g' "Dockerfile.profiling"
-sed -i -e 's/apk\ update/apt-get\ update/g' "Dockerfile.profiling" 
-sed -i -e 's/apk\ add/apt-get\ install\ -y/g' "Dockerfile.profiling" 
+sed -i -e 's/apk\ update/apt-get\ update/g' "Dockerfile.profiling"
+sed -i -e 's/apk\ add/apt-get\ install\ -y/g' "Dockerfile.profiling"
 sed -i -e 's/apk\ del/apt-get\ remove\ -y/g' "Dockerfile.profiling"
 sed -i -e 's/pcre-dev/libpcre2-dev/g' "Dockerfile.profiling"
 sed -i -e 's/zlib/zlibc/g' "Dockerfile.profiling"
-sed -i -e 's/zlibc-dev/lua-zlib\ lua-zlib-dev/g' "Dockerfile.profiling" 
+sed -i -e 's/zlibc-dev/lua-zlib\ lua-zlib-dev/g' "Dockerfile.profiling"
 sed -i -e 's/perl-test-longstring/libtest-longstring-perl/g' "Dockerfile.profiling"
-sed -i -e 's/perl-list-moreutils/liblist-moreutils-perl/g' "Dockerfile.profiling" 
-sed -i -e 's/perl-http-message/libhttp-message-perl/g' "Dockerfile.profiling" 
+sed -i -e 's/perl-list-moreutils/liblist-moreutils-perl/g' "Dockerfile.profiling"
+sed -i -e 's/perl-http-message/libhttp-message-perl/g' "Dockerfile.profiling"
 sed -i -e 's/geoip-dev/libgeoip-dev/g' "Dockerfile.profiling"
-sed -i -e 's/jemalloc/libjemalloc1/g' "Dockerfile.profiling" 
-sed -i -e 's/libjemalloc1-dev/libjemalloc-dev/g' "Dockerfile.profiling" 
-sed -i -e 's/openssl-dev/libssl-dev/g' "Dockerfile.profiling" 
+sed -i -e 's/jemalloc/libjemalloc1/g' "Dockerfile.profiling"
+sed -i -e 's/libjemalloc1-dev/libjemalloc-dev/g' "Dockerfile.profiling"
+sed -i -e 's/openssl-dev/libssl-dev/g' "Dockerfile.profiling"
 sed -i -e 's/--with-debug/--with-debug\ --with-dtrace-probes/g' "Dockerfile.profiling"
 sed -i -e 's/OPENRESTY_VERSION=.*\ /OPENRESTY_VERSION=1.11.2.2\ /g' "Dockerfile.profiling"
-sed -i -e 's/adduser\ -S.*/useradd\ nginx-api-gateway/g' "Dockerfile.profiling" 
+sed -i -e 's/adduser\ -S.*/useradd\ nginx-api-gateway/g' "Dockerfile.profiling"
 sed -i -e 's/&&\ addgroup.*//g' "Dockerfile.profiling"
-sed -i -e 's/ENTRYPOINT.*//g' "Dockerfile.profiling" 
+sed -i -e 's/ENTRYPOINT.*//g' "Dockerfile.profiling"
 sed -i -e 's/CMD.*//g' "Dockerfile.profiling"
 
 cp api-gateway.conf api-gateway.conf.profiling
diff --git a/doc/v1/management_interface_v1.md b/doc/v1/management_interface_v1.md
index 4c5318f..be16f82 100644
--- a/doc/v1/management_interface_v1.md
+++ b/doc/v1/management_interface_v1.md
@@ -23,7 +23,7 @@ The following defines the v1 interface for managing APIs and Tenants. These
endp
 ## APIs
 
 ### PUT /v1/apis
-Create a new API. Note that you should first create a tenant and obtain its `tenantId`. 
+Create a new API. Note that you should first create a tenant and obtain its `tenantId`.
 
 _body_:
 ```
@@ -88,7 +88,7 @@ _body_:
   "tenantId": *(string),
   "resources": {
     "<path>": {
-      "cors": { 
+      "cors": {
         "origin": *(string),
         "methods": *(string)
       },
diff --git a/doc/v1/policies.md b/doc/v1/policies.md
index d768db1..d9eed89 100644
--- a/doc/v1/policies.md
+++ b/doc/v1/policies.md
@@ -18,7 +18,7 @@
 
 Policies
 ==============
-The following defines the different policies that can be used when creating an API. 
+The following defines the different policies that can be used when creating an API.
 
 ## Currently supported policies
 - `rateLimit`
@@ -27,12 +27,12 @@ The following defines the different policies that can be used when creating
an A
 ## Rate Limiting (`rateLimit`)
 This policy allows for rate limiting calls based on the [leaky bucket](https://en.wikipedia.org/wiki/Leaky_bucket)
algorithm.
 - **interval**: the time interval that the rate is applied to, in seconds.
-- **rate**: the number of calls allowed per interval of time.  
-- **scope**: `api`, `tenant`, `resource`.  
-- **subscription** (optional): `true`, `false`.  
-    - If subscription is `true`, the rate limit applies to each user with a vaild subscription.
 
-    - If subscription is `false`, the rate limit applies the collective usage from all users.
 
-    
+- **rate**: the number of calls allowed per interval of time.
+- **scope**: `api`, `tenant`, `resource`.
+- **subscription** (optional): `true`, `false`.
+    - If subscription is `true`, the rate limit applies to each user with a vaild subscription.
+    - If subscription is `false`, the rate limit applies the collective usage from all users.
+
 Example:
 ```
 {
@@ -111,7 +111,7 @@ Example:
    }
 }
 ```
-This will move the value of the `foo` query parameter from the incoming request to the `bar`
field in the backend request body. 
+This will move the value of the `foo` query parameter from the incoming request to the `bar`
field in the backend request body.
 
 You can also specify `*` as the `name` for the mapping to apply for all fields in that location.
 
@@ -129,12 +129,12 @@ Example:
    }
 }
 ```
-This will move all incoming `query` parameters into the `body` in the backend request.  
+This will move all incoming `query` parameters into the `body` in the backend request.
 
 #### Note on Path Parameter Mappings
 To define a path parameter, you will need to wrap curly brackets `{}` around the path parameter
in the url.
 
-Example: 
+Example:
 
 Mapping an incoming path parameter to a backend path parameter
 
diff --git a/doc/v1/security.md b/doc/v1/security.md
index 4ccb58d..61a82d2 100644
--- a/doc/v1/security.md
+++ b/doc/v1/security.md
@@ -46,16 +46,16 @@ Example:
 ]
 ```
 
-## Client Secret (`clientSecret`) 
+## Client Secret (`clientSecret`)
 
 Enforces Client ID / Client Secret pair authorization to secure api calls.
 - **type**: `clientSecret`
 - **scope**: `api`, `tenant`, `resource`
 - **idFieldName** (optional): custom name of the client id header (default is `x-client-id`)
-- **secretFieldName** (optional): custom name of the client secret header (default is `x-client-secret`)

+- **secretFieldName** (optional): custom name of the client secret header (default is `x-client-secret`)
 - **location** (optional): location where the clientId and clientSecret are passed, either
as a header ('header') or query string ('query') (default is `header`)
 
-Example: 
+Example:
 ```
 "security":[
   {
@@ -66,7 +66,7 @@ Example:
     "location": "header"
   }
 ]
-``` 
+```
 
 This will create two API keys for the API, which will need to be supplied in the `X-IBM-ClientId`
and `X-IBM-ClientSecret` headers or query strings, respectively.
 
@@ -76,10 +76,10 @@ Perform token introspection for various social login providers and enforce
token
 
 - **type**: `oauth2`
 - **scope**: `api`, `tenant`, `resource`
-- **provider**: which oauth token provider to use (facebook, google, github) 
+- **provider**: which oauth token provider to use (facebook, google, github)
 
 Example:
-``` 
+```
 "security":[
   {
     "type":"apiKey",
@@ -87,7 +87,7 @@ Example:
     "header":"test"
   },
   {
-    "type":"oauth2", 
+    "type":"oauth2",
     "scope":"api",
     "provider":"google"
   }
diff --git a/doc/v2/management_interface_v2.md b/doc/v2/management_interface_v2.md
index 22e743b..0f22bb8 100644
--- a/doc/v2/management_interface_v2.md
+++ b/doc/v2/management_interface_v2.md
@@ -19,7 +19,7 @@
 Management Interface v2
 ==============
 
-The following defines the v2 interface for managing APIs using the [OpenAPI 2.0 spec](http://swagger.io/specification/).

+The following defines the v2 interface for managing APIs using the [OpenAPI 2.0 spec](http://swagger.io/specification/).
 
 ## API
 
@@ -206,7 +206,7 @@ _returns:_
  * `artifact_id`: the id associated with this API
  * `managed_url`: the base url to use to invoke this API
  * `open_api_doc`: the OpenAPI doc
- 
+
 ### GET /v2/{tenant_id}/apis/{artifact_id}
 Get a specific managed API for a tenant by its id.
 
@@ -225,7 +225,7 @@ _returns:_
  * `artifact_id`: the id associated with this API
  * `managed_url`: the base url to use to invoke this API
  * `open_api_doc`: the OpenAPI doc
- 
+
 ### DELETE /v2/{tenant_id}/apis/{artifact_id}
 Delete a specific managed API for a tenant by its id.
 
@@ -262,7 +262,7 @@ _body_:
 * `artifact_id`: the id associated with this API
 * `client_id`: the client id associated with this subscription for this API
 * `client_secret`: optional client secret associated with this subscription for this API.
Note that once a client_secret has been created, there is no way to retrieve its value as
it is stored as a hash inside the gateway.
-  
+
 _returns:_
 
 ```
@@ -308,7 +308,7 @@ See below for a list of policies that are supported in the gateway and
how they
 * <b>Target-url and Operation-switch</b>
 
   Set the target-url (ie. the backend for your API) for all paths using the `invoke` policy
inside the `x-gateway-configuration` extension.
-  
+
   _Example:_
   ```
   "x-gateway-configuration": {
@@ -326,12 +326,12 @@ See below for a list of policies that are supported in the gateway and
how they
   }
   ```
   * `target-url`: the backend url
-    * _optional:_ to pass the path of your managed url down to the `target-url`, append `/${request.path}`
to the end of `target-url`.  
+    * _optional:_ to pass the path of your managed url down to the `target-url`, append `/${request.path}`
to the end of `target-url`.
     Eg. `"target-url": "https://openwhisk.ng.bluemix.net/api/some/action/path.http/${request.path}"`
   * `verb`: the method to use when invoking the target-url (use "keep" to use the keep the
same verb as the API)
-  
+
   To set a different `target-url` for different paths, use the `operation-switch` policy
inside `x-gateway-configuration`.
-  
+
   _Example:_
   ```
   "x-gateway-configuration": {
@@ -377,9 +377,9 @@ See below for a list of policies that are supported in the gateway and
how they
   * inside the `operations` array for each case, specify the `operationId` of the path to
which you want the `target-url` to apply
 
 * <b>Client Id and Client Secret</b>
-  
+
   Secure your managed API with a client id and an optional client secret.
-  
+
   _Example:_
   ```
   "securityDefinitions": {
@@ -401,7 +401,7 @@ See below for a list of policies that are supported in the gateway and
how they
 * <b>Rate Limiting</b>
 
   Rate limit your managed API using the [Leaky Bucket](https://en.wikipedia.org/wiki/Leaky_bucket)
algorithm.
-  
+
   _Example:_
   ```
   "x-gateway-rate-limit": [
@@ -419,9 +419,9 @@ See below for a list of policies that are supported in the gateway and
how they
 * <b>CORS</b>
 
   Enable or disable CORS (Cross-Origin Resource Sharing) using the `x-gateway-configuration`
extension.
-  
+
   _Example:_
-  
+
   ```
   "x-gateway-configuration": {
     "cors": {
diff --git a/init.sh b/init.sh
index 20d846a..4c4cd35 100755
--- a/init.sh
+++ b/init.sh
@@ -66,4 +66,4 @@ if [[ -n "${redis_host}" && -n "${redis_port}" ]]; then
          -f /var/log/api-gateway/gateway_error.log -f /var/log/api-gateway/management.log
 else
     echo "REDIS_HOST and/or REDIS_PORT not defined"
-fi
\ No newline at end of file
+fi
diff --git a/tests/install-deps.sh b/tests/install-deps.sh
index 7ca05c4..74f124c 100755
--- a/tests/install-deps.sh
+++ b/tests/install-deps.sh
@@ -27,4 +27,4 @@ luarocks install --tree=lua_modules luasocket
 luarocks install --tree=lua_modules sha1
 luarocks install --tree=lua_modules md5
 luarocks install --tree=lua_modules net-url
-luarocks install --tree=lua_modules luafilesystem
\ No newline at end of file
+luarocks install --tree=lua_modules luafilesystem
diff --git a/tests/run-tests.sh b/tests/run-tests.sh
index de22732..3a90230 100755
--- a/tests/run-tests.sh
+++ b/tests/run-tests.sh
@@ -17,4 +17,4 @@
 #
 
 # Run unit tests
-busted --output=TAP --helper=set_paths --pattern=.lua scripts
\ No newline at end of file
+busted --output=TAP --helper=set_paths --pattern=.lua scripts

-- 
To stop receiving notification emails like this one, please contact
pdesai@apache.org.

Mime
View raw message