예제 #1
0
        public async Task <ActionResult> GetProvisioningProfilesAsync(CancellationToken cancellationToken)
        {
            var provisioningProfiles = await this.developerProfile.GetProvisioningProfilesAsync(cancellationToken).ConfigureAwait(false);

            var summaries = provisioningProfiles.Select(p => ProvisioningProfile.Read(p)).ToList();

            return(this.Ok(summaries));
        }
예제 #2
0
        /// <summary>
        /// Asynchronously adds a provisioning profile to the cluster.
        /// </summary>
        /// <param name="profile">
        /// A <see cref="SignedCms"/> object which represents the provisioning profile to add.
        /// </param>
        /// <param name="cancellationToken">
        /// A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.
        /// </param>
        /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
        public virtual async Task <ProvisioningProfile> AddProvisioningProfileAsync(SignedCms profile, CancellationToken cancellationToken)
        {
            if (profile == null)
            {
                throw new ArgumentNullException(nameof(profile));
            }

            var secret        = profile.AsSecret();
            var signedProfile = ProvisioningProfile.Read(profile);

            secret.Metadata.Name = signedProfile.Uuid.ToString();
            secret.Metadata.Labels[Annotations.DeveloperProfileComponent] = Annotations.ProvisioningProfile;

            await this.secretClient.CreateAsync(secret, cancellationToken).ConfigureAwait(false);

            return(signedProfile);
        }
예제 #3
0
 public void Read_ThrowsOnNull()
 {
     Assert.Throws <ArgumentNullException>("signedData", () => ProvisioningProfile.Read(null));
 }