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

add AK/SK Certification for uploading snapshot to cloud #972

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
89 changes: 87 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
version = "2.0.0"

[[constraint]]
branch = "master"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR is too huge for a single commit. 16K+ lines of code, please split it up.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

name = "github.com/gophercloud/gophercloud"
revision = "3ad89c4ea008e0e0b729720040b0be25a35d4615"

[[constraint]]
name = "github.com/ceph/go-ceph"
Expand Down Expand Up @@ -101,3 +101,7 @@
go-tests = true
non-go = true
unused-packages = true

[[constraint]]
name = "github.com/emicklei/go-restful"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need go-restfull lib?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for getting signature. the code uses go-restful lib.

version = "=2.8.0"
37 changes: 37 additions & 0 deletions contrib/backup/multicloud/auth/auth.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2019 The OpenSDS Authors.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fileter is used for api-server client, please remove this code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry,this is used for keystone.go, I can not remove this code.

//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenSDS copyright missing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is these lines written newly by us?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenSDS copyright missing

Its there in the line 1

// Licensed 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.

package auth

import (
"github.com/emicklei/go-restful"
"github.com/micro/go-log"
c "github.com/opensds/opensds/contrib/backup/multicloud/context"
)

type NoAuth struct {
}

func (auth *NoAuth) Filter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {
log.Log("Noauth filter begin")
ctx := req.Attribute(c.KContext).(*c.Context)
log.Log(ctx.TenantId)
params := req.PathParameters()
if tenantId, ok := params["tenantId"]; ok {
ctx.TenantId = tenantId
}

ctx.IsAdmin = ctx.TenantId == c.NoAuthAdminTenantId
chain.ProcessFilter(req, resp)
}
Loading