Skip to content

Commit

Permalink
Add license headers and clarifications for sources we didn't write
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/incubator/deltacloud/trunk@1074359 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
David Lutterkort committed Feb 25, 2011
1 parent f719574 commit 95c0708
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 4 deletions.
26 changes: 26 additions & 0 deletions server/lib/sinatra/accept_media_types.rb
@@ -1,3 +1,29 @@
#
# Based on https://github.com/mynyml/rack-accept-media-types
# Commit 3d0f38882a466cc72043
#
# Original license:
# Copyright (C) 2009 Martin Aumont (mynyml)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.

module Rack
class Request
# The media types of the HTTP_ACCEPT header ordered according to their
Expand Down
18 changes: 18 additions & 0 deletions server/lib/sinatra/lazy_auth.rb
@@ -1,3 +1,21 @@
#
# Copyright (C) 2009-2011 Red Hat, Inc.
#
# 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.

require 'sinatra/base'

# Lazy Basic HTTP authentication. Authentication is only forced when the
Expand Down
23 changes: 20 additions & 3 deletions server/lib/sinatra/rabbit.rb
@@ -1,3 +1,21 @@
#
# Copyright (C) 2009-2011 Red Hat, Inc.
#
# 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.

require 'sinatra/base'
require 'sinatra/url_for'
require 'deltacloud/validation'
Expand Down Expand Up @@ -66,10 +84,10 @@ def generate_documentation
def generate_options
current_operation = self
::Sinatra::Application.options("/api/#{current_operation.collection.name}/#{current_operation.name}") do
required_params = current_operation.effective_params(driver).collect do |name, validation|
required_params = current_operation.effective_params(driver).collect do |name, validation|
name.to_s if validation.type.eql?(:required)
end.compact.join(',')
optional_params = current_operation.effective_params(driver).collect do |name, validation|
optional_params = current_operation.effective_params(driver).collect do |name, validation|
name.to_s if validation.type.eql?(:optional)
end.compact.join(',')
headers 'X-Required-Parameters' => required_params
Expand Down Expand Up @@ -337,4 +355,3 @@ def options(path, opts={}, &block)
end
Sinatra::Delegator.delegate :options
end

20 changes: 19 additions & 1 deletion server/lib/sinatra/rack_driver_select.rb
@@ -1,3 +1,21 @@
#
# Copyright (C) 2010-2011 Red Hat, Inc.
#
# 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.

module Rack
class DriverSelect

Expand All @@ -10,7 +28,7 @@ def initialize(app, opts={})
'HTTP_X_DELTACLOUD_DRIVER' => :driver,
'HTTP_X_DELTACLOUD_PROVIDER' => :provider
}

def call(env)
original_settings = { }
HEADER_TO_ENV_MAP.each do |header, name|
Expand Down
26 changes: 26 additions & 0 deletions server/lib/sinatra/url_for.rb
@@ -1,3 +1,29 @@
#
# Based on https://github.com/emk/sinatra-url-for/
# Commit 1df339284203f8f6ed8d
#
# Original license:
# Copyright (C) 2009 Eric Kidd
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.

require 'uri'

module Sinatra
Expand Down

0 comments on commit 95c0708

Please sign in to comment.