コード例 #1
0
        public async Task <ApiSecretsDto> GetApiSecretAsync(int apiSecretId)
        {
            var apiSecret = await _apiResourceRepository.GetApiSecretAsync(apiSecretId);

            if (apiSecret == null)
            {
                throw new UserFriendlyErrorPageException(string.Format(_apiResourceServiceResources.ApiSecretDoesNotExist().Description, apiSecretId), _apiResourceServiceResources.ApiSecretDoesNotExist().Description);
            }
            var apiSecretsDto = apiSecret.ToModel();

            return(apiSecretsDto);
        }
コード例 #2
0
        public virtual async Task <ApiSecretsDto> GetApiSecretAsync(int apiSecretId)
        {
            var apiSecret = await ApiResourceRepository.GetApiSecretAsync(apiSecretId);

            if (apiSecret == null)
            {
                throw new UserFriendlyErrorPageException(string.Format(ApiResourceServiceResources.ApiSecretDoesNotExist().Description, apiSecretId), ApiResourceServiceResources.ApiSecretDoesNotExist().Description);
            }
            var apiSecretsDto = apiSecret.ToModel();

            await AuditEventLogger.LogEventAsync(new ApiSecretRequestedEvent(apiSecretsDto.ApiResourceId, apiSecretsDto.ApiSecretId, apiSecretsDto.Type, apiSecretsDto.Expiration));

            return(apiSecretsDto);
        }