Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GoogleWebAuthorizationBroker and FileDataStore on NetStandard #962

Merged
merged 4 commits into from
Mar 30, 2017

Conversation

chrisdunelm
Copy link
Contributor

Fixes #897

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 29, 2017
@chrisdunelm
Copy link
Contributor Author

Integration tests pass on:

  • Window desktop
  • Windows core
  • MacOS core

I haven't tested on Linux Core yet, but will before merging.

{
var stream = client.GetStream();

var buffer = new byte[1];

This comment was marked as spam.

@sguergachi
Copy link

Would this also fix #941 ?

Copy link
Collaborator

@jskeet jskeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly fine, but several comments :)

/// The reason that this is not 'private const' is that a user can change it and store the credentials in a
/// different location.
/// </remarks>
public static string Folder = "Google.Apis.Auth";

This comment was marked as spam.

This comment was marked as spam.

return redirectUri;
}

return redirectUri = string.Format(LoopbackCallback, GetRandomUnusedPort());

This comment was marked as spam.

This comment was marked as spam.

Port = ((IPEndPoint)_listener.LocalEndpoint).Port;
}

private TcpListener _listener;

This comment was marked as spam.

This comment was marked as spam.

catch (ServerException e)
{
Logger.Warning("{0}", e.Message);
throw e;

This comment was marked as spam.

This comment was marked as spam.

{
try
{
return await GetQueryParamsFromClientAsync(client, ct);

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

throw new ServerException("Unexpected end of network stream waiting for headers.");
}
c0 = c1;
c1 = (char)b;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

// Looking for an empty line, terminated by \r\n
int byteCount = 0;
int lineLength = 0;
char c0 = (char)0;

This comment was marked as spam.

This comment was marked as spam.

/// </summary>
/// <param name="folder">Folder path.</param>
/// <param name="fullPath">
/// Defines weather the folder parameter is absolute or relative to

This comment was marked as spam.

This comment was marked as spam.

string path =
Environment.GetEnvironmentVariable("APPDATA") ?? // Windows
Environment.GetEnvironmentVariable("HOME"); // Linux, MacOS
if (path == "")

This comment was marked as spam.

This comment was marked as spam.

{
string path =
Environment.GetEnvironmentVariable("APPDATA") ?? // Windows
Environment.GetEnvironmentVariable("HOME"); // Linux, MacOS

This comment was marked as spam.

This comment was marked as spam.

Copy link
Collaborator

@jskeet jskeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further change to support ISO-8859-1 just in case coming, as discussed offline - otherwise fine.

@chrisdunelm chrisdunelm merged commit 12dbe82 into googleapis:master Mar 30, 2017
@chrisdunelm chrisdunelm deleted the webauth branch March 30, 2017 09:25
@chrisdunelm
Copy link
Contributor Author

chrisdunelm commented Apr 7, 2017

@sguergachi This partially fixes #941, in that there is now a FileDataStore available for netstandard and therefore UWP. However, if we decide to support UWP I would expect we'll provide an IDataStore implementation using Windows.Storage, which is more suitable for a UWP application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants