Skip to content

Commit

Permalink
disable nuget package restore
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Oct 18, 2014
1 parent 8c628be commit 1f004ef
Show file tree
Hide file tree
Showing 129 changed files with 139,279 additions and 151 deletions.
5 changes: 4 additions & 1 deletion .gitignore
@@ -1,3 +1,5 @@
!*

#################
## Eclipse
#################
Expand Down Expand Up @@ -145,8 +147,9 @@ publish/

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
packages/
# packages/
dlls/
dllssigned/

# Windows Azure Build Output
csx
Expand Down
41 changes: 38 additions & 3 deletions MediaBrowser.Api/ConnectService.cs
@@ -1,13 +1,18 @@
using MediaBrowser.Controller.Connect;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Connect;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Connect;
using ServiceStack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace MediaBrowser.Api
{
[Route("/Users/{Id}/Connect/Link", "POST", Summary = "Creates a Connect link for a user")]
[Authenticated(Roles = "Admin")]
public class CreateConnectLink : IReturn<UserLinkResult>
{
[ApiMember(Name = "Id", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
Expand All @@ -18,13 +23,15 @@ public class CreateConnectLink : IReturn<UserLinkResult>
}

[Route("/Users/{Id}/Connect/Link", "DELETE", Summary = "Removes a Connect link for a user")]
[Authenticated(Roles = "Admin")]
public class DeleteConnectLink : IReturnVoid
{
[ApiMember(Name = "Id", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")]
public string Id { get; set; }
}

[Route("/Connect/Invite", "POST", Summary = "Creates a Connect link for a user")]
[Authenticated(Roles = "Admin")]
public class CreateConnectInvite : IReturn<UserLinkResult>
{
[ApiMember(Name = "ConnectUsername", Description = "Connect username", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
Expand All @@ -36,26 +43,37 @@ public class CreateConnectInvite : IReturn<UserLinkResult>


[Route("/Connect/Pending", "GET", Summary = "Creates a Connect link for a user")]
[Authenticated(Roles = "Admin")]
public class GetPendingGuests : IReturn<List<ConnectAuthorization>>
{
}


[Route("/Connect/Pending", "DELETE", Summary = "Deletes a Connect link for a user")]
[Authenticated(Roles = "Admin")]
public class DeleteAuthorization : IReturnVoid
{
[ApiMember(Name = "Id", Description = "Authorization Id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")]
public string Id { get; set; }
}

[Authenticated(Roles = "Admin")]
[Route("/Connect/Exchange", "GET", Summary = "Gets the corresponding local user from a connect user id")]
[Authenticated]
public class GetLocalUser : IReturn<ConnectAuthenticationExchangeResult>
{
[ApiMember(Name = "ConnectUserId", Description = "ConnectUserId", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
public string ConnectUserId { get; set; }
}

public class ConnectService : BaseApiService
{
private readonly IConnectManager _connectManager;
private readonly IUserManager _userManager;

public ConnectService(IConnectManager connectManager)
public ConnectService(IConnectManager connectManager, IUserManager userManager)
{
_connectManager = connectManager;
_userManager = userManager;
}

public object Post(CreateConnectLink request)
Expand Down Expand Up @@ -88,5 +106,22 @@ public void Delete(DeleteAuthorization request)

Task.WaitAll(task);
}

public object Get(GetLocalUser request)
{
var user = _userManager.Users
.FirstOrDefault(i => string.Equals(i.ConnectUserId, request.ConnectUserId, StringComparison.OrdinalIgnoreCase));

if (user == null)
{
throw new ResourceNotFoundException();
}

return ToOptimizedResult(new ConnectAuthenticationExchangeResult
{
AccessToken = user.ConnectAccessKey,
LocalUserId = user.Id.ToString("N")
});
}
}
}
1 change: 0 additions & 1 deletion MediaBrowser.Api/MediaBrowser.Api.csproj
Expand Up @@ -11,7 +11,6 @@
<AssemblyName>MediaBrowser.Api</AssemblyName>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
Expand Down
Expand Up @@ -11,7 +11,6 @@
<AssemblyName>MediaBrowser.Common.Implementations</AssemblyName>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
Expand Down Expand Up @@ -120,7 +119,6 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
<PropertyGroup>
<PostBuildEvent Condition=" '$(ConfigurationName)' != 'Release Mono' ">if '$(ConfigurationName)' == 'Release' (
xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i
Expand Down
2 changes: 0 additions & 2 deletions MediaBrowser.Common/MediaBrowser.Common.csproj
Expand Up @@ -11,7 +11,6 @@
<AssemblyName>MediaBrowser.Common</AssemblyName>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
Expand Down Expand Up @@ -116,7 +115,6 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
<PropertyGroup>
<PostBuildEvent Condition=" '$(ConfigurationName)' != 'Release Mono' ">if '$(ConfigurationName)' == 'Release' (
xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i
Expand Down
2 changes: 0 additions & 2 deletions MediaBrowser.Controller/MediaBrowser.Controller.csproj
Expand Up @@ -11,7 +11,6 @@
<AssemblyName>MediaBrowser.Controller</AssemblyName>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
Expand Down Expand Up @@ -369,7 +368,6 @@ xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
2 changes: 0 additions & 2 deletions MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
Expand Up @@ -12,7 +12,6 @@
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -91,7 +90,6 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
Expand Up @@ -15,7 +15,6 @@
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<FodyPath>..\packages\Fody.1.19.1.0</FodyPath>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand Down Expand Up @@ -224,6 +223,9 @@
<Compile Include="..\MediaBrowser.Model\Configuration\XbmcMetadataOptions.cs">
<Link>Configuration\XbmcMetadataOptions.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Connect\ConnectAuthenticationExchangeResult.cs">
<Link>ApiClient\ConnectAuthenticationExchangeResult.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Connect\ConnectAuthenticationResult.cs">
<Link>Connect\ConnectAuthenticationResult.cs</Link>
</Compile>
Expand Down Expand Up @@ -1114,7 +1116,6 @@
xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\portable\" /y /d /r /i
)</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Import Project="Fody.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
5 changes: 3 additions & 2 deletions MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj
Expand Up @@ -13,7 +13,6 @@
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<FodyPath>..\packages\Fody.1.17.0.0</FodyPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down Expand Up @@ -190,6 +189,9 @@
<Compile Include="..\MediaBrowser.Model\Configuration\XbmcMetadataOptions.cs">
<Link>Configuration\XbmcMetadataOptions.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Connect\ConnectAuthenticationExchangeResult.cs">
<Link>Connect\ConnectAuthenticationExchangeResult.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Connect\ConnectAuthenticationResult.cs">
<Link>Connect\ConnectAuthenticationResult.cs</Link>
</Compile>
Expand Down Expand Up @@ -1065,7 +1067,6 @@
xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\net35\" /y /d /r /i
)</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
27 changes: 26 additions & 1 deletion MediaBrowser.Model/ApiClient/ServerCredentials.cs
Expand Up @@ -30,7 +30,32 @@ public void AddOrUpdateServer(ServerInfo server)

if (index != -1)
{
list[index] = server;
var existing = list[index];

// Merge the data
existing.DateLastAccessed = new[] { existing.DateLastAccessed, server.DateLastAccessed }.Max();

if (!string.IsNullOrEmpty(server.AccessToken))
{
existing.AccessToken = server.AccessToken;
existing.UserId = server.UserId;
}
if (!string.IsNullOrEmpty(server.RemoteAddress))
{
existing.RemoteAddress = server.RemoteAddress;
}
if (!string.IsNullOrEmpty(server.LocalAddress))
{
existing.LocalAddress = server.LocalAddress;
}
if (!string.IsNullOrEmpty(server.Name))
{
existing.Name = server.Name;
}
if (server.WakeOnLanInfos != null && server.WakeOnLanInfos.Count > 0)
{
existing.WakeOnLanInfos = server.WakeOnLanInfos.ToList();
}
}
else
{
Expand Down
1 change: 0 additions & 1 deletion MediaBrowser.Model/Configuration/ServerConfiguration.cs
Expand Up @@ -231,7 +231,6 @@ public ServerConfiguration()
"Roku",
"Chromecast",
"iOS",
"Android",
"Windows Phone"
};

Expand Down
17 changes: 17 additions & 0 deletions MediaBrowser.Model/Connect/ConnectAuthenticationExchangeResult.cs
@@ -0,0 +1,17 @@

namespace MediaBrowser.Model.Connect
{
public class ConnectAuthenticationExchangeResult
{
/// <summary>
/// Gets or sets the local user identifier.
/// </summary>
/// <value>The local user identifier.</value>
public string LocalUserId { get; set; }
/// <summary>
/// Gets or sets the access token.
/// </summary>
/// <value>The access token.</value>
public string AccessToken { get; set; }
}
}
3 changes: 1 addition & 2 deletions MediaBrowser.Model/MediaBrowser.Model.csproj
Expand Up @@ -11,7 +11,6 @@
<AssemblyName>MediaBrowser.Model</AssemblyName>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<FodyPath>..\packages\Fody.1.19.1.0</FodyPath>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
Expand Down Expand Up @@ -98,6 +97,7 @@
<Compile Include="Configuration\PeopleMetadataOptions.cs" />
<Compile Include="Configuration\XbmcMetadataOptions.cs" />
<Compile Include="Configuration\SubtitlePlaybackMode.cs" />
<Compile Include="Connect\ConnectAuthenticationExchangeResult.cs" />
<Compile Include="Connect\ConnectAuthenticationResult.cs" />
<Compile Include="Connect\ConnectAuthorization.cs" />
<Compile Include="Connect\ConnectUser.cs" />
Expand Down Expand Up @@ -424,7 +424,6 @@
xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\net45\" /y /d /r /i
)</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
<Import Project="Fody.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Binary file added MediaBrowser.Model/PropertyChanged.dll
Binary file not shown.
2 changes: 0 additions & 2 deletions MediaBrowser.Providers/MediaBrowser.Providers.csproj
Expand Up @@ -11,7 +11,6 @@
<AssemblyName>MediaBrowser.Providers</AssemblyName>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
Expand Down Expand Up @@ -215,7 +214,6 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
Expand Up @@ -68,7 +68,10 @@ public AuthService(IUserManager userManager, ISessionManager sessionManager, IAu
if (!string.IsNullOrWhiteSpace(auth.Token) ||
!_config.Configuration.InsecureApps2.Contains(auth.Client ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
SessionManager.ValidateSecurityToken(auth.Token);
if (!IsValidConnectKey(auth.Token))
{
SessionManager.ValidateSecurityToken(auth.Token);
}
}
}

Expand Down Expand Up @@ -115,6 +118,16 @@ public AuthService(IUserManager userManager, ISessionManager sessionManager, IAu
}
}

private bool IsValidConnectKey(string token)
{
if (!string.IsNullOrEmpty(token))
{
return UserManager.Users.Any(u => string.Equals(token, u.ConnectAccessKey, StringComparison.OrdinalIgnoreCase) && !string.IsNullOrEmpty(u.ConnectAccessKey));
}

return false;
}

protected bool DoHtmlRedirectIfConfigured(IRequest req, IResponse res, bool includeRedirectParam = false)
{
var htmlRedirect = this.HtmlRedirect ?? AuthenticateService.HtmlRedirect;
Expand Down

0 comments on commit 1f004ef

Please sign in to comment.