Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
a304f5d2
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a304f5d2
编写于
4月 24, 2020
作者:
W
WangFengTu
提交者:
lifeng68
7月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init registry module and fix copyright
Signed-off-by:
N
WangFengTu
<
wangfengtu@huawei.com
>
上级
3a60aeb7
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
125 addition
and
87 deletion
+125
-87
src/cutils/utils_aes.c
src/cutils/utils_aes.c
+5
-5
src/cutils/utils_aes.h
src/cutils/utils_aes.h
+5
-5
src/cutils/utils_base64.c
src/cutils/utils_base64.c
+5
-5
src/cutils/utils_base64.h
src/cutils/utils_base64.h
+5
-5
src/image/oci/oci_image.c
src/image/oci/oci_image.c
+9
-0
src/image/oci/registry/aes.c
src/image/oci/registry/aes.c
+5
-5
src/image/oci/registry/aes.h
src/image/oci/registry/aes.h
+5
-5
src/image/oci/registry/auths.c
src/image/oci/registry/auths.c
+5
-5
src/image/oci/registry/auths.h
src/image/oci/registry/auths.h
+5
-5
src/image/oci/registry/certs.c
src/image/oci/registry/certs.c
+5
-5
src/image/oci/registry/certs.h
src/image/oci/registry/certs.h
+5
-5
src/image/oci/registry/http_request.c
src/image/oci/registry/http_request.c
+5
-5
src/image/oci/registry/http_request.h
src/image/oci/registry/http_request.h
+5
-5
src/image/oci/registry/registry.c
src/image/oci/registry/registry.c
+24
-9
src/image/oci/registry/registry.h
src/image/oci/registry/registry.h
+7
-8
src/image/oci/registry/registry_apiv2.c
src/image/oci/registry/registry_apiv2.c
+5
-5
src/image/oci/registry/registry_apiv2.h
src/image/oci/registry/registry_apiv2.h
+5
-5
src/image/oci/registry/registry_type.h
src/image/oci/registry/registry_type.h
+15
-0
未找到文件。
src/cutils/utils_aes.c
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-03-26
* Create: 2020-03-26
* Description: provide base64 functions
* Description: provide base64 functions
...
...
src/cutils/utils_aes.h
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-04-21
* Create: 2020-04-21
* Description: provide aes functions
* Description: provide aes functions
...
...
src/cutils/utils_base64.c
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-03-26
* Create: 2020-03-26
* Description: provide base64 functions
* Description: provide base64 functions
...
...
src/cutils/utils_base64.h
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-03-26
* Create: 2020-03-26
* Description: provide base64 functions
* Description: provide base64 functions
...
...
src/image/oci/oci_image.c
浏览文件 @
a304f5d2
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include "isula_images_list.h"
#include "isula_images_list.h"
#include "isula_containers_list.h"
#include "isula_containers_list.h"
#include "isula_storage_metadata.h"
#include "isula_storage_metadata.h"
#include "registry.h"
#include "containers_store.h"
#include "containers_store.h"
#include "oci_images_store.h"
#include "oci_images_store.h"
...
@@ -95,12 +96,20 @@ out:
...
@@ -95,12 +96,20 @@ out:
int
oci_init
(
const
struct
service_arguments
*
args
)
int
oci_init
(
const
struct
service_arguments
*
args
)
{
{
int
ret
=
-
1
;
int
ret
=
-
1
;
registry_init_options
options
;
if
(
args
==
NULL
)
{
if
(
args
==
NULL
)
{
ERROR
(
"Invalid image config"
);
ERROR
(
"Invalid image config"
);
return
ret
;
return
ret
;
}
}
options
.
use_decrypted_key
=
conf_get_use_decrypted_key_flag
();
options
.
skip_tls_verify
=
conf_get_skip_insecure_verify_flag
();
ret
=
registry_init
(
&
options
);
if
(
ret
!=
0
)
{
goto
out
;
}
if
(
storage_module_init_helper
(
args
)
!=
0
)
{
if
(
storage_module_init_helper
(
args
)
!=
0
)
{
ret
=
-
1
;
ret
=
-
1
;
goto
out
;
goto
out
;
...
...
src/image/oci/registry/aes.c
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-04-23
* Create: 2020-04-23
* Description: provide aes process functions
* Description: provide aes process functions
...
...
src/image/oci/registry/aes.h
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-04-23
* Create: 2020-04-23
* Description: provide aes process definition
* Description: provide aes process definition
...
...
src/image/oci/registry/auths.c
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-03-20
* Create: 2020-03-20
* Description: provide auths file process functions
* Description: provide auths file process functions
...
...
src/image/oci/registry/auths.h
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-03-20
* Create: 2020-03-20
* Description: provide auths file process definition
* Description: provide auths file process definition
...
...
src/image/oci/registry/certs.c
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-03-20
* Create: 2020-03-20
* Description: provide auths file process functions
* Description: provide auths file process functions
...
...
src/image/oci/registry/certs.h
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-03-20
* Create: 2020-03-20
* Description: provide certs file process definition
* Description: provide certs file process definition
...
...
src/image/oci/registry/http_request.c
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-03-20
* Create: 2020-03-20
* Description: provide http request functions
* Description: provide http request functions
...
...
src/image/oci/registry/http_request.h
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-03-05
* Create: 2020-03-05
* Description: provide http request definition
* Description: provide http request definition
...
...
src/image/oci/registry/registry.c
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-02-27
* Create: 2020-02-27
* Description: provide registry functions
* Description: provide registry functions
...
@@ -39,6 +39,8 @@
...
@@ -39,6 +39,8 @@
#define MANIFEST_BIG_DATA_KEY "manifest"
#define MANIFEST_BIG_DATA_KEY "manifest"
#define ROOTFS_TYPE "layers"
#define ROOTFS_TYPE "layers"
static
registry_init_options
g_options
;
static
int
parse_manifest_schema1
(
pull_descriptor
*
desc
)
static
int
parse_manifest_schema1
(
pull_descriptor
*
desc
)
{
{
registry_manifest_schema1
*
manifest
=
NULL
;
registry_manifest_schema1
*
manifest
=
NULL
;
...
@@ -1152,8 +1154,8 @@ static int prepare_pull_desc(pull_descriptor *desc, registry_pull_options *optio
...
@@ -1152,8 +1154,8 @@ static int prepare_pull_desc(pull_descriptor *desc, registry_pull_options *optio
desc
->
dest_image_name
=
util_strdup_s
(
options
->
dest_image_name
);
desc
->
dest_image_name
=
util_strdup_s
(
options
->
dest_image_name
);
desc
->
scope
=
util_strdup_s
(
scope
);
desc
->
scope
=
util_strdup_s
(
scope
);
desc
->
blobpath
=
util_strdup_s
(
blobpath
);
desc
->
blobpath
=
util_strdup_s
(
blobpath
);
desc
->
use_decrypted_key
=
options
->
comm_opt
.
use_decrypted_key
;
desc
->
use_decrypted_key
=
g_options
.
use_decrypted_key
;
desc
->
skip_tls_verify
=
options
->
comm_opt
.
skip_tls_verify
;
desc
->
skip_tls_verify
=
g_options
.
skip_tls_verify
;
if
(
options
->
auth
.
username
!=
NULL
&&
options
->
auth
.
password
!=
NULL
)
{
if
(
options
->
auth
.
username
!=
NULL
&&
options
->
auth
.
password
!=
NULL
)
{
desc
->
username
=
util_strdup_s
(
options
->
auth
.
username
);
desc
->
username
=
util_strdup_s
(
options
->
auth
.
username
);
...
@@ -1227,6 +1229,19 @@ out:
...
@@ -1227,6 +1229,19 @@ out:
return
ret
;
return
ret
;
}
}
int
registry_init
(
registry_init_options
*
options
)
{
if
(
options
==
NULL
)
{
ERROR
(
"Invalid NULL param when init registry module"
);
return
-
1
;
}
g_options
.
use_decrypted_key
=
options
->
use_decrypted_key
;
g_options
.
skip_tls_verify
=
options
->
skip_tls_verify
;
return
0
;
}
int
registry_login
(
registry_login_options
*
options
)
int
registry_login
(
registry_login_options
*
options
)
{
{
int
ret
=
0
;
int
ret
=
0
;
...
@@ -1247,8 +1262,8 @@ int registry_login(registry_login_options *options)
...
@@ -1247,8 +1262,8 @@ int registry_login(registry_login_options *options)
}
}
desc
->
host
=
util_strdup_s
(
options
->
host
);
desc
->
host
=
util_strdup_s
(
options
->
host
);
desc
->
use_decrypted_key
=
options
->
comm_opt
.
use_decrypted_key
;
desc
->
use_decrypted_key
=
g_options
.
use_decrypted_key
;
desc
->
skip_tls_verify
=
options
->
comm_opt
.
skip_tls_verify
;
desc
->
skip_tls_verify
=
g_options
.
skip_tls_verify
;
desc
->
username
=
util_strdup_s
(
options
->
auth
.
username
);
desc
->
username
=
util_strdup_s
(
options
->
auth
.
username
);
desc
->
password
=
util_strdup_s
(
options
->
auth
.
password
);
desc
->
password
=
util_strdup_s
(
options
->
auth
.
password
);
...
...
src/image/oci/registry/registry.h
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-02-27
* Create: 2020-02-27
* Description: provide registry definition
* Description: provide registry definition
...
@@ -22,7 +22,7 @@ extern "C" {
...
@@ -22,7 +22,7 @@ extern "C" {
typedef
struct
{
typedef
struct
{
bool
use_decrypted_key
;
bool
use_decrypted_key
;
bool
skip_tls_verify
;
bool
skip_tls_verify
;
}
registry_options
;
}
registry_
init_
options
;
typedef
struct
{
typedef
struct
{
char
*
username
;
char
*
username
;
...
@@ -30,18 +30,17 @@ typedef struct {
...
@@ -30,18 +30,17 @@ typedef struct {
}
registry_auth
;
}
registry_auth
;
typedef
struct
{
typedef
struct
{
registry_options
comm_opt
;
registry_auth
auth
;
registry_auth
auth
;
char
*
image_name
;
char
*
image_name
;
char
*
dest_image_name
;
char
*
dest_image_name
;
}
registry_pull_options
;
}
registry_pull_options
;
typedef
struct
{
typedef
struct
{
registry_options
comm_opt
;
registry_auth
auth
;
registry_auth
auth
;
char
*
host
;
char
*
host
;
}
registry_login_options
;
}
registry_login_options
;
int
registry_init
(
registry_init_options
*
options
);
int
registry_pull
(
registry_pull_options
*
options
);
int
registry_pull
(
registry_pull_options
*
options
);
int
registry_login
(
registry_login_options
*
options
);
int
registry_login
(
registry_login_options
*
options
);
int
registry_logout
(
char
*
host
);
int
registry_logout
(
char
*
host
);
...
...
src/image/oci/registry/registry_apiv2.c
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-03-05
* Create: 2020-03-05
* Description: provide registry api v2 functions
* Description: provide registry api v2 functions
...
...
src/image/oci/registry/registry_apiv2.h
浏览文件 @
a304f5d2
/******************************************************************************
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v
1
.
* iSulad licensed under the Mulan PSL v
2
.
* You can use this software according to the terms and conditions of the Mulan PSL v
1
.
* You can use this software according to the terms and conditions of the Mulan PSL v
2
.
* You may obtain a copy of Mulan PSL v
1
at:
* You may obtain a copy of Mulan PSL v
2
at:
* http://license.coscl.org.cn/MulanPSL
* http://license.coscl.org.cn/MulanPSL
2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* PURPOSE.
* See the Mulan PSL v
1
for more details.
* See the Mulan PSL v
2
for more details.
* Author: wangfengtu
* Author: wangfengtu
* Create: 2020-03-05
* Create: 2020-03-05
* Description: provide registry api v2 definition
* Description: provide registry api v2 definition
...
...
src/image/oci/registry/registry_type.h
浏览文件 @
a304f5d2
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Author: wangfengtu
* Create: 2020-04-23
* Description: provide registry type definition
******************************************************************************/
#ifndef _IMAGE_REGISTRY_TYPE_H
#ifndef _IMAGE_REGISTRY_TYPE_H
#define _IMAGE_REGISTRY_TYPE_H
#define _IMAGE_REGISTRY_TYPE_H
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录