Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Project
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
apis
Project
Commits
fd6641ce
Commit
fd6641ce
authored
5 years ago
by
L. Ellenbeck
Browse files
Options
Downloads
Patches
Plain Diff
Added gitlab implementation coscine/issues#183
parent
c1fab9de
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!13
New: Handling multiple DataSources
,
!12
New: Gitlab implementation
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Project/Controllers/DataSourceController.cs
+48
-19
48 additions, 19 deletions
src/Project/Controllers/DataSourceController.cs
with
48 additions
and
19 deletions
src/Project/Controllers/DataSourceController.cs
+
48
−
19
View file @
fd6641ce
...
...
@@ -82,7 +82,7 @@ namespace Coscine.Api.Project.Controllers
}
else
if
(
resource
.
Type
.
DisplayName
.
ToLower
()
==
"gitlab"
)
{
authHeader
=
BuildGitlabAuthHeader
();
authHeader
=
BuildGitlabAuthHeader
(
resource
.
ExternalId
,
resource
.
Url
);
}
if
(
authHeader
!=
null
)
...
...
@@ -136,35 +136,64 @@ namespace Coscine.Api.Project.Controllers
var
auth
=
new
Dictionary
<
string
,
object
>();
var
credentials
=
new
Dictionary
<
string
,
object
>
{
{
"access_key"
,
_configuration
.
GetString
(
"coscine/global/rds_access_key"
)
},
{
"secret_key"
,
_configuration
.
GetString
(
"coscine/global/rds_secret_key"
)
}
};
{
{
"access_key"
,
_configuration
.
GetString
(
"coscine/global/rds_access_key"
)
},
{
"secret_key"
,
_configuration
.
GetString
(
"coscine/global/rds_secret_key"
)
}
};
var
settings
=
new
Dictionary
<
string
,
object
>
{
{
"bucket"
,
bucketname
}
};
{
{
"bucket"
,
bucketname
}
};
var
data
=
new
Dictionary
<
string
,
object
>
{
{
"auth"
,
auth
},
{
"credentials"
,
credentials
},
{
"settings"
,
settings
},
{
"callback_url"
,
"rwth-aachen.de"
}
};
{
{
"auth"
,
auth
},
{
"credentials"
,
credentials
},
{
"settings"
,
settings
},
{
"callback_url"
,
"rwth-aachen.de"
}
};
var
payload
=
new
JwtPayload
{
{
"data"
,
data
}
};
{
{
"data"
,
data
}
};
return
_jwtHandler
.
GenerateJwtToken
(
payload
);
}
private
string
BuildGitlabAuthHeader
()
private
string
BuildGitlabAuthHeader
(
string
externalId
,
string
url
)
{
return
null
;
var
auth
=
new
Dictionary
<
string
,
object
>();
var
credentials
=
new
Dictionary
<
string
,
object
>
{
{
"token"
,
_configuration
.
GetString
(
"coscine/global/gitlabtoken"
)
}
};
var
settings
=
new
Dictionary
<
string
,
object
>
{
{
"owner"
,
"Tester"
},
{
"repo"
,
url
},
{
"repo_id"
,
externalId
},
{
"host"
,
"https://git.rwth-aachen.de"
}
};
var
data
=
new
Dictionary
<
string
,
object
>
{
{
"auth"
,
auth
},
{
"credentials"
,
credentials
},
{
"settings"
,
settings
},
{
"callback_url"
,
"rwth-aachen.de"
}
};
var
payload
=
new
JwtPayload
{
{
"data"
,
data
}
};
return
_jwtHandler
.
GenerateJwtToken
(
payload
);
}
}
}
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