Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Commits
365f2695
Verified
Commit
365f2695
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: authentication
parent
3e7fbed2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#9454
passed with warnings
3 years ago
Stage: info
Stage: setup
Stage: test
Stage: deploy
Pipeline: caosdb-cppinttest
#9457
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosdbcli.cpp
+9
-13
9 additions, 13 deletions
src/caosdbcli.cpp
with
9 additions
and
13 deletions
src/caosdbcli.cpp
+
9
−
13
View file @
365f2695
...
...
@@ -27,6 +27,7 @@
#include
"caosdb/info/v1alpha1/main.pb.h"
#include
"constants.h"
#include
"connection.h"
#include
"authentication.h"
#include
"utils.h"
auto
main
()
->
int
{
...
...
@@ -36,24 +37,19 @@ auto main() -> int {
<<
caosdb
::
LIBCAOSDB_VERSION_PATCH
<<
")"
<<
std
::
endl
;
std
::
cout
<<
"We don't miss the H of caos."
<<
std
::
endl
;
const
auto
pem_file_path
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_CA_PEM"
,
std
::
string
());
std
::
string
pem
=
caosdb
::
utils
::
load_string_file
(
pem_file_path
);
const
auto
pem_file
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_CA_PEM"
,
std
::
string
());
const
auto
host
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_HOST"
,
"localhost"
);
const
auto
port_str
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_PORT"
,
"8000"
);
const
auto
port
=
std
::
stoi
(
port_str
);
std
::
cout
<<
"PEM"
<<
pem
<<
"
\n
"
;
const
std
::
string
host
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_HOST"
,
"localhost"
);
const
std
::
string
port_str
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_PORT"
,
"8000"
);
const
int
port
=
std
::
stoi
(
port_str
);
auto
cacert
=
std
::
make_shared
<
caosdb
::
PemCACertProvider
>
(
pem
);
auto
auth
=
std
::
make_shared
<
caosdb
::
authentication
::
PlainPasswordAuthenticator
>
(
"tf"
,
"vuY36moa"
);
auto
cacert
=
std
::
make_shared
<
caosdb
::
PemFileCACertProvider
>
(
pem_file
);
auto
config
=
std
::
make_shared
<
caosdb
::
SslCaosDBConnectionConfig
>
(
host
,
port
,
cacert
);
std
::
make_shared
<
caosdb
::
SslCaosDBConnectionConfig
>
(
host
,
port
,
cacert
,
auth
);
caosdb
::
CaosDBConnection
connection
(
config
);
std
::
cout
<<
std
::
endl
<<
connection
<<
std
::
endl
;
const
auto
&
v_info
=
connection
.
getVersionInfo
();
const
auto
&
build
=
v_info
.
build
();
//
const auto &build = v_info.build();
// std::cout << "BUILD(" << build[0] << ")" << std::endl;
std
::
cout
<<
"VersionInfo("
<<
v_info
.
major
()
<<
"."
<<
v_info
.
minor
()
<<
"."
<<
v_info
.
patch
()
<<
")"
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment