Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
keystore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
id
keystore
Commits
81c2463e
Commit
81c2463e
authored
2 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Update Client with session IDs
parent
46112664
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#45238
failed
2 years ago
Stage: build
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/client.go
+10
-8
10 additions, 8 deletions
client/client.go
with
10 additions
and
8 deletions
client/client.go
+
10
−
8
View file @
81c2463e
...
...
@@ -14,9 +14,9 @@ var ErrNoKeys = errors.New("no keys available")
// Client for the keystore API.
type
Client
interface
{
Open
(
context
.
Context
,
string
,
string
,
string
,
int
)
error
Open
(
context
.
Context
,
string
,
string
,
string
,
string
,
int
)
error
Get
(
context
.
Context
,
string
,
string
,
string
)
([]
byte
,
error
)
Close
(
context
.
Context
,
string
,
string
)
error
Close
(
context
.
Context
,
string
,
string
,
string
)
error
}
type
ksClient
struct
{
...
...
@@ -32,11 +32,12 @@ func New(config *clientutil.BackendConfig) (Client, error) {
return
&
ksClient
{
be
},
nil
}
func
(
c
*
ksClient
)
Open
(
ctx
context
.
Context
,
shard
,
username
,
password
string
,
ttl
int
)
error
{
func
(
c
*
ksClient
)
Open
(
ctx
context
.
Context
,
shard
,
username
,
password
,
sessionID
string
,
ttl
int
)
error
{
req
:=
keystore
.
OpenRequest
{
Username
:
username
,
Password
:
password
,
TTL
:
ttl
,
Username
:
username
,
Password
:
password
,
TTL
:
ttl
,
SessionID
:
sessionID
,
}
var
resp
keystore
.
OpenResponse
return
c
.
be
.
Call
(
ctx
,
shard
,
"/api/open"
,
&
req
,
&
resp
)
...
...
@@ -58,9 +59,10 @@ func (c *ksClient) Get(ctx context.Context, shard, username, ssoTicket string) (
return
resp
.
Key
,
err
}
func
(
c
*
ksClient
)
Close
(
ctx
context
.
Context
,
shard
,
username
string
)
error
{
func
(
c
*
ksClient
)
Close
(
ctx
context
.
Context
,
shard
,
username
,
sessionID
string
)
error
{
req
:=
keystore
.
CloseRequest
{
Username
:
username
,
Username
:
username
,
SessionID
:
sessionID
,
}
var
resp
keystore
.
CloseResponse
return
c
.
be
.
Call
(
ctx
,
shard
,
"/api/close"
,
&
req
,
&
resp
)
...
...
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