Commit 9026994a authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Cleanup

parent 32ff2dfe
......@@ -4,7 +4,7 @@
<#@ include file="$(ProjectDir)\LinqToDB.Templates\PluralizationService.ttinclude" #>
<#@ assembly name="$(ProjectDir)..\packages\Coscine.Configuration.1.5.0\lib\net461\Coscine.Configuration.dll"#>
<#@ assembly name="$(ProjectDir)..\packages\Coscine.Migrations.1.8.1-topic-1125-apito0006\lib\net461\Coscine.Migrations.dll" #>
<#@ assembly name="$(ProjectDir)..\packages\Coscine.Migrations.1.9.0-topic-1125-apito0006\lib\net461\Coscine.Migrations.dll" #>
<#@ assembly name="$(ProjectDir)..\packages\Coscine.Database.Helpers.1.1.0\lib\net461\Coscine.Database.Helpers.dll" #>
<#@ assembly name="$(ProjectDir)..\packages\Microsoft.Extensions.DependencyInjection.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll"#>
......
......@@ -49,8 +49,8 @@
<Reference Include="Coscine.Database.Helpers, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.Helpers.1.1.0\lib\net461\Coscine.Database.Helpers.dll</HintPath>
</Reference>
<Reference Include="Coscine.Migrations, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Migrations.1.8.1-topic-1125-apito0006\lib\net461\Coscine.Migrations.dll</HintPath>
<Reference Include="Coscine.Migrations, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Migrations.1.9.0-topic-1125-apito0006\lib\net461\Coscine.Migrations.dll</HintPath>
</Reference>
<Reference Include="FluentMigrator, Version=3.2.8.0, Culture=neutral, PublicKeyToken=aacfc7de5acabf05, processorArchitecture=MSIL">
<HintPath>..\packages\FluentMigrator.3.2.8\lib\net461\FluentMigrator.dll</HintPath>
......@@ -193,7 +193,6 @@
<DependentUpon>CsDatabase.tt</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<None Include="x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
......@@ -226,14 +225,6 @@
</ItemGroup>
<ItemGroup>
<Content Include="LinqToDB.Templates\CopyMe.SqlServer.tt.txt" />
<Content Include="x86\Microsoft.VC90.CRT\msvcr90.dll" />
<Content Include="x86\Microsoft.VC90.CRT\README_ENU.txt" />
<Content Include="x86\sqlceca40.dll" />
<Content Include="x86\sqlcecompact40.dll" />
<Content Include="x86\sqlceer40EN.dll" />
<Content Include="x86\sqlceme40.dll" />
<Content Include="x86\sqlceqp40.dll" />
<Content Include="x86\sqlcese40.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
......
......@@ -3,7 +3,7 @@
<package id="Consul" version="0.7.2.6" targetFramework="net461" />
<package id="Coscine.Configuration" version="1.5.0" targetFramework="net461" />
<package id="Coscine.Database.Helpers" version="1.1.0" targetFramework="net461" />
<package id="Coscine.Migrations" version="1.8.1-topic-1125-apito0006" targetFramework="net461" />
<package id="Coscine.Migrations" version="1.9.0-topic-1125-apito0006" targetFramework="net461" />
<package id="FluentMigrator" version="3.2.8" targetFramework="net461" />
<package id="FluentMigrator.Abstractions" version="3.2.8" targetFramework="net461" />
<package id="FluentMigrator.Extensions.Oracle" version="3.2.8" targetFramework="net461" />
......
......@@ -43,8 +43,8 @@
<Reference Include="Coscine.Database.Helpers, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.Helpers.1.1.0\lib\net461\Coscine.Database.Helpers.dll</HintPath>
</Reference>
<Reference Include="Coscine.Migrations, Version=1.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Migrations.1.8.0-topic-1125-apito0005\lib\net461\Coscine.Migrations.dll</HintPath>
<Reference Include="Coscine.Migrations, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Migrations.1.9.0-topic-1125-apito0006\lib\net461\Coscine.Migrations.dll</HintPath>
</Reference>
<Reference Include="FluentMigrator, Version=3.2.8.0, Culture=neutral, PublicKeyToken=aacfc7de5acabf05, processorArchitecture=MSIL">
<HintPath>..\packages\FluentMigrator.3.2.8\lib\net461\FluentMigrator.dll</HintPath>
......
......@@ -3,7 +3,7 @@
<package id="Consul" version="0.7.2.6" targetFramework="net461" />
<package id="Coscine.Configuration" version="1.5.0" targetFramework="net461" />
<package id="Coscine.Database.Helpers" version="1.1.0" targetFramework="net461" />
<package id="Coscine.Migrations" version="1.8.0-topic-1125-apito0005" targetFramework="net461" />
<package id="Coscine.Migrations" version="1.9.0-topic-1125-apito0006" targetFramework="net461" />
<package id="FluentMigrator" version="3.2.8" targetFramework="net461" />
<package id="FluentMigrator.Abstractions" version="3.2.8" targetFramework="net461" />
<package id="FluentMigrator.Extensions.Oracle" version="3.2.8" targetFramework="net461" />
......
......@@ -38,7 +38,7 @@ namespace Coscine.Database.Models
public IEnumerable<ApiTokenObject> GetTokens(Guid userId)
{
return GetAllWhere((tableEntry) => tableEntry.UserId == userId)
.Select(x => new ApiTokenObject { TokenId = x.Id.ToString(), Created = x.IssuedAt, Expires = x.Expiration, Name = x.Name })
.Select(x => new ApiTokenObject { TokenId = x.Id, Created = x.IssuedAt, Expires = x.Expiration, Name = x.Name })
.OrderBy(x => x.Created);
}
......@@ -50,7 +50,7 @@ namespace Coscine.Database.Models
return null;
}
return new ApiTokenObject { TokenId = t.Id.ToString(), Created = t.IssuedAt, Expires = t.Expiration, Name = t.Name };
return new ApiTokenObject { TokenId = t.Id, Created = t.IssuedAt, Expires = t.Expiration, Name = t.Name };
}
public User GetUser(Guid tokenId)
......@@ -79,10 +79,11 @@ namespace Coscine.Database.Models
public int Revoke(Guid userId, Guid tokenId)
{
var apiToken = GetById(tokenId);
if(apiToken.UserId == userId)
if (apiToken.UserId == userId)
{
return Delete(apiToken);
} else
}
else
{
return 0;
}
......
......@@ -5,7 +5,7 @@ namespace Coscine.Database.ReturnObjects
[Serializable]
public class ApiTokenObject : IReturnObject
{
public string TokenId { get; set; }
public Guid TokenId { get; set; }
public string Name { get; set; }
public DateTime Created { get; set; }
public DateTime Expires { get; set; }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment