diff --git a/aliyun/aliyun.go b/aliyun/aliyun.go index 9ff630b..30239a6 100644 --- a/aliyun/aliyun.go +++ b/aliyun/aliyun.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 aliyun import ( diff --git a/aliyun/aliyun_test.go b/aliyun/aliyun_test.go index 967e217..4b53bff 100644 --- a/aliyun/aliyun_test.go +++ b/aliyun/aliyun_test.go @@ -1,7 +1,20 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 aliyun_test import ( - "fmt" "testing" aliyunoss "github.com/aliyun/aliyun-oss-go-sdk/oss" @@ -26,11 +39,13 @@ var client, privateClient *aliyun.Client func init() { config := AppConfig{} - configor.New(&configor.Config{ENVPrefix: "ALIYUN"}).Load(&config) + err := configor.New(&configor.Config{ENVPrefix: "ALIYUN"}).Load(&config) + if err != nil { + panic(err) + } - if len(config.Private.AccessID) == 0 { - fmt.Println("No aliyun configuration") - return + if config.Private.AccessID == "" { + panic("No aliyun configuration") } client = aliyun.New(&aliyun.Config{ @@ -39,6 +54,7 @@ func init() { Bucket: config.Public.Bucket, Endpoint: config.Public.Endpoint, }) + privateClient = aliyun.New(&aliyun.Config{ AccessID: config.Private.AccessID, AccessKey: config.Private.AccessKey, @@ -52,8 +68,9 @@ func TestAll(t *testing.T) { if client == nil { t.Skip(`skip because of no config: `) } - clis := []*aliyun.Client{client, privateClient} - for _, cli := range clis { + + clients := []*aliyun.Client{client, privateClient} + for _, cli := range clients { tests.TestAll(cli, t) } } diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index e5ceaa9..bcf7933 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 filesystem import ( diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index 8ed9157..7a817c6 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 filesystem import ( diff --git a/googlecloud/googlecloud.go b/googlecloud/googlecloud.go index 99629b9..5127596 100644 --- a/googlecloud/googlecloud.go +++ b/googlecloud/googlecloud.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 googlecloud import ( diff --git a/googlecloud/googlecloud_test.go b/googlecloud/googlecloud_test.go index 5541a34..a9eb73f 100644 --- a/googlecloud/googlecloud_test.go +++ b/googlecloud/googlecloud_test.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 googlecloud_test import ( diff --git a/oss.go b/oss.go index f09b974..2b4e98b 100644 --- a/oss.go +++ b/oss.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 oss import ( diff --git a/qiniu/qiniu.go b/qiniu/qiniu.go index 9a3cc30..4989387 100644 --- a/qiniu/qiniu.go +++ b/qiniu/qiniu.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 qiniu import ( diff --git a/qiniu/qiniu_test.go b/qiniu/qiniu_test.go index 756b0ac..f42fbea 100644 --- a/qiniu/qiniu_test.go +++ b/qiniu/qiniu_test.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 qiniu_test import ( diff --git a/s3/s3.go b/s3/s3.go index 82ca132..c50be62 100644 --- a/s3/s3.go +++ b/s3/s3.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 s3 import ( diff --git a/s3/s3_test.go b/s3/s3_test.go index 2b0417a..d04935f 100644 --- a/s3/s3_test.go +++ b/s3/s3_test.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 s3_test import ( diff --git a/tencent/tencent.go b/tencent/tencent.go index 926e56d..5cf0fe3 100644 --- a/tencent/tencent.go +++ b/tencent/tencent.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 tencent import ( @@ -142,7 +156,7 @@ func (client Client) Delete(path string) error { return nil } -//todo not found api +// todo not found api func (client Client) List(path string) ([]*oss.Object, error) { var objects []*oss.Object diff --git a/tencent/tencent_test.go b/tencent/tencent_test.go index 5cd138a..c720727 100644 --- a/tencent/tencent_test.go +++ b/tencent/tencent_test.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 tencent import ( diff --git a/tencent/util.go b/tencent/util.go index e90d012..850480c 100644 --- a/tencent/util.go +++ b/tencent/util.go @@ -1,15 +1,29 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 tencent import ( + "crypto/hmac" "crypto/sha1" "encoding/hex" - "crypto/hmac" + "fmt" "net/http" - "strings" + "net/url" "sort" + "strings" "time" - "fmt" - "net/url" ) func sha(s string) string { diff --git a/tests/tests.go b/tests/tests.go index 5ef70ff..d51a366 100644 --- a/tests/tests.go +++ b/tests/tests.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Casdoor Authors. All Rights Reserved. +// +// 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 tests import (