Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add support for multiple metadata signatures #1156

Merged
merged 5 commits into from

6 participants

@jamestao

No description provided.

bcham and others added some commits
@bcham bcham Add support for multiple metadata signatures
Add the ability for the PowerShell cmdlets to pair with either of two
different metadata signatures. This will allow us to upgrade the
metadata signature without breaking PowerShell. Also updated the latest
signature to that of the latest management service.
29f5a02
@bcham bcham Support arbitrary number of metadata signatures 65b15b3
@bcham bcham Fix static metadata issue
- Actually use the computed metadata hash in the update script
- Fix a typo
- Shorten a verbose loop to one linq.Any() call.
af4fd81
@jamestao jamestao Merge pull request #1 from bcham/dev
Add support for multiple metadata signatures
344c004
@guangyang
Collaborator

This will be scheduled in 0.6.13 which ships on 4/10.

@andrerod andrerod commented on the diff
...e/Database/Cmdlet/NewAzureSqlDatabaseServerContext.cs
@@ -116,7 +116,7 @@ public class NewAzureSqlDatabaseServerContext : PSCmdlet
XDocument metadata = context.RetrieveMetadata();
XDocument filteredMetadata = DataConnectionUtility.FilterMetadataDocument(metadata);
string metadataHash = DataConnectionUtility.GetDocumentHash(filteredMetadata);
- if (metadataHash != context.metadataHash)
+ if (!context.metadataHashes.Any(knownHash => metadataHash == knownHash))
@andrerod Collaborator

should you use .Equals here ?

@bcham
bcham added a note

Previous behavior used !=. In this case, == and string.Equals are equivalent (not making use of culture-sensitive or case-insensitive comparison).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@azuresdkci
Owner

Can one of the admins verify this patch?

@ogail
Collaborator

ok to test

@ogail
Collaborator

test this please

@ogail
Collaborator

add to whitelist

@ogail
Collaborator

test this please

@ogail ogail merged commit 469e8e9 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 27, 2013
  1. @bcham

    Add support for multiple metadata signatures

    bcham authored
    Add the ability for the PowerShell cmdlets to pair with either of two
    different metadata signatures. This will allow us to upgrade the
    metadata signature without breaking PowerShell. Also updated the latest
    signature to that of the latest management service.
Commits on Mar 4, 2013
  1. @bcham
  2. @bcham

    Fix static metadata issue

    bcham authored
    - Actually use the computed metadata hash in the update script
    - Fix a typo
    - Shorten a verbose loop to one linq.Any() call.
Commits on Mar 5, 2013
  1. @jamestao

    Merge pull request #1 from bcham/dev

    jamestao authored
    Add support for multiple metadata signatures
Commits on Apr 2, 2013
  1. @jamestao
This page is out of date. Refresh to see the latest.
View
2  WindowsAzurePowershell/src/Management.SqlDatabase/Database/Cmdlet/NewAzureSqlDatabaseServerContext.cs
@@ -114,7 +114,7 @@ public class NewAzureSqlDatabaseServerContext : PSCmdlet
XDocument metadata = context.RetrieveMetadata();
XDocument filteredMetadata = DataConnectionUtility.FilterMetadataDocument(metadata);
string metadataHash = DataConnectionUtility.GetDocumentHash(filteredMetadata);
- if (metadataHash != context.metadataHash)
+ if (!context.metadataHashes.Any(knownHash => metadataHash == knownHash))
@andrerod Collaborator

should you use .Equals here ?

@bcham
bcham added a note

Previous behavior used !=. In this case, == and string.Equals are equivalent (not making use of culture-sensitive or case-insensitive comparison).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
{
this.WriteWarning(Resources.WarningModelOutOfDate);
}
View
4 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Server/ServerContextInternal.cs
@@ -9,7 +9,7 @@
//------------------------------------------------------------------------------
// Original file name: ServerContextInternal.cs
-// Generation date: 10/19/2012 1:58:42 PM
+// Generation date: 3/4/2013 2:03:28 PM
namespace Microsoft.WindowsAzure.Management.SqlDatabase.Services.Server
{
@@ -3274,6 +3274,6 @@ namespace Microsoft.WindowsAzure.Management.SqlDatabase.Services.Server
{
public abstract partial class ServerContextInternal
{
- public readonly string metadataHash = "3070BEE06139E0754E2F022E56E9798BF8A57F30";
+ public readonly string[] metadataHashes = new string[]{"80A53B80FCD9616E6EEBDCAA3482E30A159C0E1F", "3070BEE06139E0754E2F022E56E9798BF8A57F30"};
}
}
View
2  WindowsAzurePowershell/src/Management.SqlDatabase/Services/Server/UpdateServerDataServiceMetadata.ps1
@@ -67,7 +67,7 @@ $metadataHashDeclaration="namespace $clientModelNamespace
{
public abstract partial class $clientModelBaseContext
{
- public readonly string metadataHash = `"$metadataHash`";
+ public readonly string[] metadataHashes = new string[]{`"$metadataHash`", `"3070BEE06139E0754E2F022E56E9798BF8A57F30`"};
}
}"
$metadataHashDeclaration | Add-Content "$clientModelClassFile"
Something went wrong with that request. Please try again.