33 Commits

Author SHA1 Message Date
tomdds
13aca270ca Remove unused code in both the cloud interfaces and environment models. Also add tests for some untested code in the cloud interface. 2020-02-05 14:48:54 -05:00
tomdds
350e648beb Added tests for get and set secret 2020-02-04 17:39:31 -05:00
tomdds
e702c42fa5 Merge branch 'staging' into environment-mgmt-grp-provisioning 2020-02-04 17:05:24 -05:00
tomdds
4d11f7217e Add missing test for create_principal_admin_role 2020-02-04 16:43:06 -05:00
tomdds
9d5918d618 Add exception for problems with secrets 2020-02-04 16:42:18 -05:00
graham-dds
ff842f5051 Add cloud method to get reporting data
Adds a method to `azure_cloud_provider` to query the Cost Management API
for usage data per invoice.  For now, this query is relatively static.
We're always calling the API at the billing invoice section scope,
with the widest timeframe possible (one year), and with the same
requested dataset. As the scope of the application's reporting needs
changes, this function may change to be more general and/or revert back
to the SDK.
2020-02-04 16:07:06 -05:00
tomdds
ca4feaa403 post-rebase fixes 2020-02-04 15:39:03 -05:00
tomdds
21d48c55cf Use correct config value for create_environment resource 2020-02-04 15:21:27 -05:00
1378fcfc15 merge conflict 2020-02-04 15:21:27 -05:00
dandds
0b8886182d Fix wrong creds reference in create_applications method. 2020-02-02 14:42:44 -05:00
dandds
b1c6dd5ad0 Adds a method for creating an Active Directory user.
This method is added to the Azure cloud interface. We need to set the
AAD user's alternate email, which is a subsequent PATCH call to the API.
These two calls are handled with a single interface method and payload
because ATAT would never create a user without an associated email.

This commit also:

- Expands internal method for getting principal tokens so that it can be
  scoped to different resources.
- Retains the tenant domain name in the portfolios.csp_data column
  because ATAT needs that information for provisioning users via API.
2020-02-02 14:42:44 -05:00
tomdds
61e891258b Merge branch 'staging' into azure-subscriptions 2020-01-31 17:00:43 -05:00
tomdds
bbed83d897 Update AADP Purchase url and respose format to newer schema. 2020-01-31 15:50:10 -05:00
tomdds
9acbeeb824 Add display name to subscription creation payload
Also extracts environment -> subscription payload construction to it's own method.
2020-01-31 14:42:38 -05:00
tomdds
e672941259 Source correct tenant id for root credentials 2020-01-31 14:11:28 -05:00
tomdds
73ddd32365 Only unpack AADP purchase date after verifying response code. 2020-01-31 11:51:13 -05:00
tomdds
6b8ea41925 Make AADP purchase quantity configurable
Also remove a few constant params from the payload model.
2020-01-30 22:12:28 -05:00
tomdds
afcc4d16cd Add functionality for creating and verifying subscriptions.
Currently the create call will be consumed by on-demand requests from the frontend, and the 2 stage create will be used by the enviroment management group provisioning to verify an initial subscription was created.
2020-01-30 15:58:09 -05:00
7e4340e7e4 resolve merge conflict with staging 2020-01-30 15:57:06 -05:00
de992eeed8 premium product purchase code formatting. 2020-01-30 14:50:16 -05:00
7493b9c3d6 premium product purchase unit tests. 2020-01-30 14:48:16 -05:00
tomdds
33c6e8c68c Merge CSP secret handling implementations and refine updating. 2020-01-29 18:22:21 -05:00
tomdds
0bc0e15134 Merge branch 'staging' into azure-config-values 2020-01-29 16:50:44 -05:00
tomdds
d4dd581b7a Implement principal creation and admin elevation provisioning features. 2020-01-29 16:17:28 -05:00
a0d59aa9e4 portfolio provisioning. create product purchase and verification stages 2020-01-29 12:51:19 -05:00
dandds
abd03be806 Store and pull tenant creds from Key Vault.
The tenant ID should be hashed and used as the key for the JSON blob of
relevant creds for any given tenant. Azure CSP interface methods that
need to source creds should call the internal `_source_creds` method,
either with a `tenant_id` or no parameters. That method will source the
creds. If a tenant ID is provided, it will source them from the Key
Vault. If not provided, it will return the default creds for the app
registration in the home tenant.
2020-01-29 10:49:27 -05:00
tomdds
144312863c Draft implementations of remote admin creation and root management group ownership. 2020-01-28 20:14:50 -05:00
tomdds
7bf6b9addc Remove creds from payloads and passthroughs. 2020-01-28 14:12:04 -05:00
tomdds
475ceaed7c Source Azure Environment Values from Config
This commit switches a few previously hardcoded values to be parsed from configuration, either from the SDK or current consts.
2020-01-27 16:49:19 -05:00
dandds
ef8f92b678 Merge branch 'staging' into app-env-provisioning 2020-01-26 18:56:29 -05:00
dandds
37a5218a1d Split and barrel cloud module for merge. 2020-01-26 18:38:02 -05:00
tomdds
bcd774ffe0 Fix wildcard import in azure cloud provider. 2020-01-26 16:11:53 -05:00
tomdds
b28281d04e Break out cloud integration into smaller files. 2020-01-26 14:03:09 -05:00