Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-julialib
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-julialib
Commits
8fa72f8d
Commit
8fa72f8d
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Allow Athenticator to be managed by Julia or C
parent
e527a0c3
No related branches found
No related tags found
1 merge request
!4
ENH: Add minimal functionality
Pipeline
#10685
passed with warnings
3 years ago
Stage: info
Stage: code-style
Stage: setup
Stage: test
Stage: deploy
Pipeline: CaosDB Julia Integration Tests
#10687
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/CaosDB.jl
+9
-8
9 additions, 8 deletions
src/CaosDB.jl
src/Connection.jl
+4
-1
4 additions, 1 deletion
src/Connection.jl
with
13 additions
and
9 deletions
src/CaosDB.jl
+
9
−
8
View file @
8fa72f8d
...
@@ -81,13 +81,13 @@ authenticator object from a configuration.
...
@@ -81,13 +81,13 @@ authenticator object from a configuration.
mutable struct
_Authenticator
mutable struct
_Authenticator
wrapped_authenticator
::
Ptr
{
Cvoid
}
wrapped_authenticator
::
Ptr
{
Cvoid
}
function
_Authenticator
()
function
_Authenticator
(
managed_by_julia
::
Bool
=
false
)
auth
=
new
()
auth
=
new
()
# force this to point to C_NULL after initialization
if
managed_by_julia
auth
.
wrapped_authenticator
=
C_NULL
# Only append a finalizer for this if the object is
# actually managed by Julia and not created and destroyed
# internally by libcaosdb.
function
f
(
t
)
function
f
(
t
)
if
t
.
wrapped_authenticator
!=
C_NULL
# Only if pointer was filled after real initialization
ccall
(
ccall
(
(
:
caosdb_authentication_delete_authenticator
,
"libccaosdb"
),
(
:
caosdb_authentication_delete_authenticator
,
"libccaosdb"
),
Cint
,
Cint
,
...
@@ -95,9 +95,10 @@ mutable struct _Authenticator
...
@@ -95,9 +95,10 @@ mutable struct _Authenticator
Ref
{
_Authenticator
}(
t
),
Ref
{
_Authenticator
}(
t
),
)
)
end
end
end
finalizer
(
f
,
auth
)
finalizer
(
f
,
auth
)
end
end
return
auth
end
end
end
"""
"""
...
@@ -115,7 +116,7 @@ function create_plain_password_authenticator(
...
@@ -115,7 +116,7 @@ function create_plain_password_authenticator(
password
::
AbstractString
,
password
::
AbstractString
,
)
)
auth
=
Ref
{
_Authenticator
}(
_Authenticator
())
auth
=
Ref
{
_Authenticator
}(
_Authenticator
(
true
))
err_code
=
ccall
(
err_code
=
ccall
(
(
:
caosdb_authentication_create_plain_password_authenticator
,
"libccaosdb"
),
(
:
caosdb_authentication_create_plain_password_authenticator
,
"libccaosdb"
),
...
...
This diff is collapsed.
Click to expand it.
src/Connection.jl
+
4
−
1
View file @
8fa72f8d
...
@@ -96,6 +96,9 @@ mutable struct _Configuration
...
@@ -96,6 +96,9 @@ mutable struct _Configuration
function
_Configuration
(
managed_by_julia
::
Bool
=
false
)
function
_Configuration
(
managed_by_julia
::
Bool
=
false
)
config
=
new
()
config
=
new
()
if
managed_by_julia
if
managed_by_julia
# Only append a finalizer for this if the object is
# actually managed by Julia and not created and destroyed
# internally by libcaosdb.
function
f
(
t
)
function
f
(
t
)
ccall
(
ccall
(
(
:
caosdb_connection_delete_connection_configuration
,
"libccaosdb"
),
(
:
caosdb_connection_delete_connection_configuration
,
"libccaosdb"
),
...
@@ -274,7 +277,7 @@ to.
...
@@ -274,7 +277,7 @@ to.
"""
"""
function
get_version_info
(
con
::
Ref
{
_Connection
})
function
get_version_info
(
con
::
Ref
{
_Connection
})
info
=
Ref
{
CaosDB
.
Info
.
_VersionInfo
}(
CaosDB
.
Info
.
_VersionInfo
(
true
))
info
=
Ref
{
CaosDB
.
Info
.
_VersionInfo
}(
CaosDB
.
Info
.
_VersionInfo
())
err_code
=
ccall
(
err_code
=
ccall
(
(
:
caosdb_connection_get_version_info
,
"libccaosdb"
),
(
:
caosdb_connection_get_version_info
,
"libccaosdb"
),
...
...
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