Skip to content

Commit

Permalink
Update from master
Browse files Browse the repository at this point in the history
  • Loading branch information
SDK Automation committed Aug 13, 2020
1 parent 71e8c01 commit d518a80
Show file tree
Hide file tree
Showing 13 changed files with 480 additions and 425 deletions.
2 changes: 1 addition & 1 deletion sdk/authorization/arm-authorization/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Microsoft
Copyright (c) 2020 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
57 changes: 25 additions & 32 deletions sdk/authorization/arm-authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@ npm install @azure/arm-authorization

##### Install @azure/ms-rest-nodeauth

- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`.
```bash
npm install @azure/ms-rest-nodeauth
npm install @azure/ms-rest-nodeauth@"^3.0.0"
```

##### Sample code

```javascript
const { AuthorizationManagementClient } = require("@azure/arm-authorization");
const { interactiveLogin } = require("@azure/ms-rest-nodeauth");

```typescript
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { AuthorizationManagementClient, AuthorizationManagementModels, AuthorizationManagementMappers } from "@azure/arm-authorization";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

interactiveLogin()
.then((creds) => {
const client = new AuthorizationManagementClient(creds, subscriptionId);
client.classicAdministrators.list().then((result) => {
console.log("The result is:");
console.log(result);
});
})
.catch((err) => {
console.error(err);
msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new AuthorizationManagementClient(creds, subscriptionId);
client.classicAdministrators.list().then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```

#### browser - Authentication, client creation and list classicAdministrators as an example written in JavaScript.
Expand All @@ -57,7 +57,6 @@ npm install @azure/ms-rest-browserauth
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.

- index.html

```html
<!DOCTYPE html>
<html lang="en">
Expand All @@ -71,27 +70,21 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>",
tenant: "<optional tenant for your organization>"
});
authManager.finalizeLogin().then((res) => {
if (!res.isLoggedIn) {
// may cause redirects
authManager.login();
}
const client = new Azure.ArmAuthorization.AuthorizationManagementClient(
res.creds,
subscriptionId
);
client.classicAdministrators
.list()
.then((result) => {
console.log("The result is:");
console.log(result);
})
.catch((err) => {
console.log("An error occurred:");
console.error(err);
});
const client = new Azure.ArmAuthorization.AuthorizationManagementClient(res.creds, subscriptionId);
client.classicAdministrators.list().then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log("An error occurred:");
console.error(err);
});
});
</script>
</head>
Expand All @@ -103,4 +96,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fauthorization%2Farm-authorization%2FREADME.png)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/authorization/arm-authorization/README.png)
16 changes: 8 additions & 8 deletions sdk/authorization/arm-authorization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "@azure/arm-authorization",
"author": "Microsoft Corporation",
"description": "AuthorizationManagementClient Library with typescript type definitions for node.js and browser.",
"version": "8.3.3",
"version": "8.3.2",
"dependencies": {
"@azure/ms-rest-azure-js": "^2.0.0",
"@azure/ms-rest-js": "^2.0.3",
"tslib": "^1.9.3"
"@azure/ms-rest-azure-js": "^2.0.1",
"@azure/ms-rest-js": "^2.0.4",
"tslib": "^1.10.0"
},
"keywords": [
"node",
Expand All @@ -20,11 +20,11 @@
"module": "./esm/authorizationManagementClient.js",
"types": "./esm/authorizationManagementClient.d.ts",
"devDependencies": {
"typescript": "^3.1.1",
"rollup": "^0.66.2",
"rollup-plugin-node-resolve": "^3.4.0",
"typescript": "^3.5.3",
"rollup": "^1.18.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"uglify-js": "^3.4.9"
"uglify-js": "^3.6.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/authorization/arm-authorization",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion sdk/authorization/arm-authorization/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const config = {
*/`
},
plugins: [
nodeResolve({ module: true }),
nodeResolve({ mainFields: ['module', 'main'] }),
sourcemaps()
]
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class AuthorizationManagementClient extends AuthorizationManagementClientContext
classicAdministrators: operations.ClassicAdministrators;
globalAdministrator: operations.GlobalAdministrator;
providerOperationsMetadata: operations.ProviderOperationsMetadataOperations;
roleAssignments: operations.RoleAssignments;
permissions: operations.Permissions;
roleDefinitions: operations.RoleDefinitions;
denyAssignments: operations.DenyAssignments;
roleAssignments: operations.RoleAssignments;

/**
* Initializes a new instance of the AuthorizationManagementClient class.
Expand All @@ -36,10 +36,10 @@ class AuthorizationManagementClient extends AuthorizationManagementClientContext
this.classicAdministrators = new operations.ClassicAdministrators(this);
this.globalAdministrator = new operations.GlobalAdministrator(this);
this.providerOperationsMetadata = new operations.ProviderOperationsMetadataOperations(this);
this.roleAssignments = new operations.RoleAssignments(this);
this.permissions = new operations.Permissions(this);
this.roleDefinitions = new operations.RoleDefinitions(this);
this.denyAssignments = new operations.DenyAssignments(this);
this.roleAssignments = new operations.RoleAssignments(this);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";

const packageName = "@azure/arm-authorization";
const packageVersion = "8.3.3";
const packageVersion = "8.3.2";

export class AuthorizationManagementClientContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
Expand Down
Loading

0 comments on commit d518a80

Please sign in to comment.