Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • Fix/xxxx-activateGitlab
  • Fix/xxxx-resourceVisibility
  • Hotfix/1262-fixStatuscode
  • Hotfix/1308-versionConflict
  • Hotfix/1357-ymlFile
  • Hotfix/1370-swaggerDescription
  • Hotfix/1383-topLevel
  • Hotfix/1433-defaultQuota
  • Hotfix/1466-projectCreationTimeout
  • Hotfix/1584-fixResourceLoader
  • Hotfix/1590-quotaFix
  • Hotfix/1615-membersCreatingProject
  • Hotfix/1668-versionResourceConfigDepVersion
  • Hotfix/1669-RDS-S3QuotaManagement
  • Hotfix/1704-FixingArchiveFlag
  • Hotfix/1796-projectDdos
  • Hotfix/1917-PublicFilesVisibility
  • Hotfix/2015-PublicFilesVisibility
  • Hotfix/2077-fixSupportAdminLog
  • Hotfix/2087-efNet6
  • Hotfix/2202-fixNaNQuota
  • Hotfix/2203-quotaMembersFix
  • Hotfix/2224-quotaSizeAnalytics
  • Hotfix/2371-fixGitLabinRCV
  • Hotfix/64-releaseUDE
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1825-codeQualityPipelines
  • Issue/1825-codeQualityPipelinesNew
  • Issue/1860-searchScoping
  • Issue/1861-searchMetadata
  • Issue/1866-ExtendResourceTypeConfigurationTUDo
  • Issue/1877-ExtendResourceTypeConfigurationNRWFHs
  • Issue/1910-MigrationtoNET6.0
  • Issue/1927-projectAppMigration
  • Issue/1940ResouceKeysForNRWAndTUDO
  • Issue/1951-quotaImplementation
  • Issue/1957-resourceAppMigrationNew
  • Issue/1971-projectEditCreateMigration
  • Issue/1971-projectForDev
  • Issue/2000-gitlabResourcesAPI
  • Issue/2001-extendAnalyticsLogger
  • Issue/2008-quotaManagement
  • Issue/2061-activateResourceTypeRdss3nrw
  • Issue/2072-wormResourceType
  • Issue/2101-gitLabResTypeUi
  • Issue/2221-projectDateCreated
  • Issue/2246-quotaResoval
  • Issue/2259-updatePids
  • Issue/2287-guestRole
  • Issue/2309-docs
  • Issue/2328-noFailOnLog
  • Issue/2349-gitlabHttps
  • Issue/2355-topLevelOrg
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issues/0028-maxQuotaFix
  • Product/1100-fdsS3
  • Product/1154-resourceTypeDefinition
  • Product/1188-LoggingExtended
  • Product/1215-gitlabCleanUp
  • Product/1287-dotnet5Sharepoint
  • Product/1414-fhPrivileges
  • Product/1442-projectInviteMngmnt
  • Product/1548-projectInviteMngmnt
  • Product/1600-rdsS3QuotaManagement
  • Product/1629-onboardingOtherUniversities
  • Product/202-userInvitation
  • Product/588-quotaManagement
  • Product/932-docuProjectApi
  • Sprint/2020-20
  • Sprint/2020-21
  • Sprint/2020-22
  • Sprint/2021-01
  • Sprint/2021-02
  • Sprint/2021-03
  • Sprint/2021-05
  • Sprint/2021-08
  • Sprint/2021-09
  • Sprint/2021-10
  • Sprint/2021-11
  • Sprint/2021-12
  • Sprint/2021-13
  • Sprint/2021-15
  • Sprint/2021-19
  • Sprint/2021-2022
  • Sprint/2021-23
  • Sprint/2022-01
  • Sprint/2022-05
  • Test/xxxx-enablingGitLab
  • Topic/1115-docuProjectApi
  • Topic/1159-rtdApi
  • Topic/1221-LogginExtendedNew
  • Topic/1221-LoggingExtended
  • Topic/1279-quotaManagement
  • Topic/1292-FdsS3
  • Topic/1335-dotnet5Apis
  • Topic/1425-fhPrivileges
  • Topic/1453-userInvitation
  • Topic/1529-HandleExternalUserInvitation
  • Topic/1530-invitationUserManagement
  • Topic/1531-UseMangmntTableView
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.11.0
  • v1.11.1
  • v1.12.0
  • v1.13.0
  • v1.13.1
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.16.1
  • v1.17.0
  • v1.17.1
  • v1.18.0
  • v1.19.0
  • v1.2.0
  • v1.2.1
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.21.0
  • v1.21.1
  • v1.22.0
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.23.3
  • v1.24.0
  • v1.24.1
  • v1.25.0
  • v1.25.1
  • v1.3.0
  • v1.4.0
  • v1.4.1
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.6.2
  • v1.7.0
  • v1.7.1
  • v1.8.0
  • v1.9.0
  • v2.0.0
  • v2.0.1
  • v2.0.2
  • v2.1.0
  • v2.1.1
  • v2.1.2
  • v2.2.0
  • v2.2.1
  • v2.2.2
  • v2.2.3
  • v2.2.4
  • v2.2.5
  • v2.3.0
  • v2.4.0
  • v2.4.1
  • v2.4.2
  • v2.4.3
  • v2.5.0
  • v2.5.1
  • v2.5.2
  • v2.5.3
  • v2.5.4
  • v2.6.0
  • v2.6.1
  • v2.6.2
  • v2.7.0
  • v2.8.0
  • v2.8.1
  • v2.8.2
  • v2.8.3
  • v2.8.4
  • v2.9.0
  • v3.0.0
  • v3.0.1
  • v4.0.0
  • v4.0.1
  • v4.0.2
  • v4.0.3
  • v4.1.0
  • v4.1.1
  • v4.2.0
  • v4.2.1
  • v4.2.2
  • v4.2.3
  • v4.2.4
  • v4.2.5
  • v4.2.6
  • v4.2.7
  • v4.2.8
  • v4.3.0
  • v4.3.1
  • v4.3.2
  • v4.3.3
  • v4.3.4
  • v4.4.0
200 results

Target

Select target project
  • coscine/backend/apis/project
1 result
Select Git revision
  • Fix/xxxx-activateGitlab
  • Fix/xxxx-resourceVisibility
  • Hotfix/1262-fixStatuscode
  • Hotfix/1308-versionConflict
  • Hotfix/1357-ymlFile
  • Hotfix/1370-swaggerDescription
  • Hotfix/1383-topLevel
  • Hotfix/1433-defaultQuota
  • Hotfix/1466-projectCreationTimeout
  • Hotfix/1584-fixResourceLoader
  • Hotfix/1590-quotaFix
  • Hotfix/1615-membersCreatingProject
  • Hotfix/1668-versionResourceConfigDepVersion
  • Hotfix/1669-RDS-S3QuotaManagement
  • Hotfix/1704-FixingArchiveFlag
  • Hotfix/1796-projectDdos
  • Hotfix/1917-PublicFilesVisibility
  • Hotfix/2015-PublicFilesVisibility
  • Hotfix/2077-fixSupportAdminLog
  • Hotfix/2087-efNet6
  • Hotfix/2202-fixNaNQuota
  • Hotfix/2203-quotaMembersFix
  • Hotfix/2224-quotaSizeAnalytics
  • Hotfix/2371-fixGitLabinRCV
  • Hotfix/64-releaseUDE
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1825-codeQualityPipelines
  • Issue/1825-codeQualityPipelinesNew
  • Issue/1860-searchScoping
  • Issue/1861-searchMetadata
  • Issue/1866-ExtendResourceTypeConfigurationTUDo
  • Issue/1877-ExtendResourceTypeConfigurationNRWFHs
  • Issue/1910-MigrationtoNET6.0
  • Issue/1927-projectAppMigration
  • Issue/1940ResouceKeysForNRWAndTUDO
  • Issue/1951-quotaImplementation
  • Issue/1957-resourceAppMigrationNew
  • Issue/1971-projectEditCreateMigration
  • Issue/1971-projectForDev
  • Issue/2000-gitlabResourcesAPI
  • Issue/2001-extendAnalyticsLogger
  • Issue/2008-quotaManagement
  • Issue/2061-activateResourceTypeRdss3nrw
  • Issue/2072-wormResourceType
  • Issue/2101-gitLabResTypeUi
  • Issue/2221-projectDateCreated
  • Issue/2246-quotaResoval
  • Issue/2259-updatePids
  • Issue/2287-guestRole
  • Issue/2309-docs
  • Issue/2328-noFailOnLog
  • Issue/2349-gitlabHttps
  • Issue/2355-topLevelOrg
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issues/0028-maxQuotaFix
  • Product/1100-fdsS3
  • Product/1154-resourceTypeDefinition
  • Product/1188-LoggingExtended
  • Product/1215-gitlabCleanUp
  • Product/1287-dotnet5Sharepoint
  • Product/1414-fhPrivileges
  • Product/1442-projectInviteMngmnt
  • Product/1548-projectInviteMngmnt
  • Product/1600-rdsS3QuotaManagement
  • Product/1629-onboardingOtherUniversities
  • Product/202-userInvitation
  • Product/588-quotaManagement
  • Product/932-docuProjectApi
  • Sprint/2020-20
  • Sprint/2020-21
  • Sprint/2020-22
  • Sprint/2021-01
  • Sprint/2021-02
  • Sprint/2021-03
  • Sprint/2021-05
  • Sprint/2021-08
  • Sprint/2021-09
  • Sprint/2021-10
  • Sprint/2021-11
  • Sprint/2021-12
  • Sprint/2021-13
  • Sprint/2021-15
  • Sprint/2021-19
  • Sprint/2021-2022
  • Sprint/2021-23
  • Sprint/2022-01
  • Sprint/2022-05
  • Test/xxxx-enablingGitLab
  • Topic/1115-docuProjectApi
  • Topic/1159-rtdApi
  • Topic/1221-LogginExtendedNew
  • Topic/1221-LoggingExtended
  • Topic/1279-quotaManagement
  • Topic/1292-FdsS3
  • Topic/1335-dotnet5Apis
  • Topic/1425-fhPrivileges
  • Topic/1453-userInvitation
  • Topic/1529-HandleExternalUserInvitation
  • Topic/1530-invitationUserManagement
  • Topic/1531-UseMangmntTableView
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.11.0
  • v1.11.1
  • v1.12.0
  • v1.13.0
  • v1.13.1
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.16.1
  • v1.17.0
  • v1.17.1
  • v1.18.0
  • v1.19.0
  • v1.2.0
  • v1.2.1
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.21.0
  • v1.21.1
  • v1.22.0
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.23.3
  • v1.24.0
  • v1.24.1
  • v1.25.0
  • v1.25.1
  • v1.3.0
  • v1.4.0
  • v1.4.1
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.6.2
  • v1.7.0
  • v1.7.1
  • v1.8.0
  • v1.9.0
  • v2.0.0
  • v2.0.1
  • v2.0.2
  • v2.1.0
  • v2.1.1
  • v2.1.2
  • v2.2.0
  • v2.2.1
  • v2.2.2
  • v2.2.3
  • v2.2.4
  • v2.2.5
  • v2.3.0
  • v2.4.0
  • v2.4.1
  • v2.4.2
  • v2.4.3
  • v2.5.0
  • v2.5.1
  • v2.5.2
  • v2.5.3
  • v2.5.4
  • v2.6.0
  • v2.6.1
  • v2.6.2
  • v2.7.0
  • v2.8.0
  • v2.8.1
  • v2.8.2
  • v2.8.3
  • v2.8.4
  • v2.9.0
  • v3.0.0
  • v3.0.1
  • v4.0.0
  • v4.0.1
  • v4.0.2
  • v4.0.3
  • v4.1.0
  • v4.1.1
  • v4.2.0
  • v4.2.1
  • v4.2.2
  • v4.2.3
  • v4.2.4
  • v4.2.5
  • v4.2.6
  • v4.2.7
  • v4.2.8
  • v4.3.0
  • v4.3.1
  • v4.3.2
  • v4.3.3
  • v4.3.4
  • v4.4.0
200 results
Show changes
Commits on Source (3)
......@@ -9,8 +9,8 @@ using System.Reflection;
[assembly: AssemblyDescription("Project.Tests is a part of the CoScInE group.")]
[assembly: AssemblyCompany("IT Center, RWTH Aachen University")]
[assembly: AssemblyProduct("Project.Tests")]
[assembly: AssemblyVersion("1.6.1.0")]
[assembly: AssemblyFileVersion("1.6.1.0")]
[assembly: AssemblyInformationalVersion("1.6.1.0")]
[assembly: AssemblyVersion("1.6.2.0")]
[assembly: AssemblyFileVersion("1.6.2.0")]
[assembly: AssemblyInformationalVersion("1.6.2.0")]
[assembly: AssemblyCopyright("2019 IT Center, RWTH Aachen University")]
using Coscine.Api.Project.Models;
using Coscine.Api.Project.ReturnObjects;
using Coscine.ApiCommons;
using Coscine.ApiCommons.Factories;
using Coscine.ApiCommons.Utils;
using Coscine.Configuration;
using Coscine.Database.Model;
......@@ -255,6 +256,66 @@ namespace Coscine.Api.Project.Controllers
}
}
[HttpPost("[controller]/validate")]
public async Task<IActionResult> IsResourceValid()
{
var path = "/";
JToken resource = ObjectFactory<JToken>.DeserializeFromStream(Request.Body);
string authHeader = null;
if (resource["type"]["displayName"].ToString().ToLower() == "rds")
{
RDSResourceType rdsResourceType = new RDSResourceType();
rdsResourceType.BucketName = resource["resourceTypeOption"]["BucketName"].ToString();
rdsResourceType.AccessKey = resource["resourceTypeOption"]["AccessKey"].ToString();
rdsResourceType.SecretKey = resource["resourceTypeOption"]["SecretKey"].ToString();
authHeader = BuildRdsAuthHeader(rdsResourceType);
}
else if (resource["type"]["displayName"].ToString().ToLower() == "gitlab")
{
GitlabResourceType gitlabResourceType = new GitlabResourceType();
gitlabResourceType.RepositoryNumber = (int)resource["resourceTypeOption"]["RepositoryNumber"];
gitlabResourceType.RepositoryUrl = resource["resourceTypeOption"]["RepositoryUrl"].ToString();
gitlabResourceType.Token = resource["resourceTypeOption"]["Token"].ToString();
authHeader = BuildGitlabAuthHeader(gitlabResourceType);
}
if (authHeader == null)
{
return BadRequest($"No provider for: \"{resource["type"]["displayName"].ToString()}\".");
}
else
{
// If the path is null, an empty string is added.
string url = $"{_configuration.GetString("coscine/global/waterbutler_url")}{resource["type"]["displayName"].ToString().ToLower()}{path}";
var request = new HttpRequestMessage(HttpMethod.Get, url);
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", authHeader);
// Thread safe according to msdn and HttpCompletionOption sets it to get only headers first.
var response = await Client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
if (response.IsSuccessStatusCode)
{
if (response.Content.Headers.Contains("Content-Disposition"))
{
return File(await response.Content.ReadAsStreamAsync(),
response.Content.Headers.GetValues("Content-Type").First());
}
else
{
var data = JObject.Parse(await response.Content.ReadAsStringAsync())["data"];
return Ok(new WaterbutlerObject(path, data));
}
}
else
{
return FailedRequest(response, path);
}
}
}
private IActionResult FailedRequest(HttpResponseMessage response, string path)
{
if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
......@@ -395,7 +456,7 @@ namespace Coscine.Api.Project.Controllers
{
{ "owner", "Tester"},
{ "repo", gitlabResourceType.RepositoryUrl},
{ "repo_id", gitlabResourceType.RepositoryNumber},
{ "repo_id", gitlabResourceType.RepositoryNumber.ToString()},
{ "host", "https://git.rwth-aachen.de"}
};
......
......@@ -9,8 +9,8 @@ using System.Reflection;
[assembly: AssemblyDescription("Project is a part of the CoScInE group.")]
[assembly: AssemblyCompany("IT Center, RWTH Aachen University")]
[assembly: AssemblyProduct("Project")]
[assembly: AssemblyVersion("1.6.1.0")]
[assembly: AssemblyFileVersion("1.6.1.0")]
[assembly: AssemblyInformationalVersion("1.6.1.0")]
[assembly: AssemblyVersion("1.6.2.0")]
[assembly: AssemblyFileVersion("1.6.2.0")]
[assembly: AssemblyInformationalVersion("1.6.2.0")]
[assembly: AssemblyCopyright("2019 IT Center, RWTH Aachen University")]