This class is responsible for the key bits of information that are needed to access our backend sites. These keys are not very secret and could easily be found, for example, by packet snooping. However, we want to keep them out of source code where someone might be able to do a google search and easily find our keys and use our storage. The keys are currently stored in a file called connections.dll. The installer must place a version of this in the EXE directory. Developers get it automatically, along with other dependencies. You can see what keys are stored in what order by checking the constructor. That will work for Parse.com, where we currently have different API keys for the sandbox. For the S3 data, we currently just use different buckets. If we wanted to, we could put the 'real data' bucket name here also, and put the appropriate one into the testing version of connections.dll. Todo: Some of the real keys are still in our version control history. Before we go live, we may want to change the keys so any keys discovered in our version control are obsolete.
Ejemplo n.º 1
0
        public BloomParseClient()
        {
            var keys = AccessKeys.GetAccessKeys(BookUpload.UploadBucketNameForCurrentEnvironment);

            RestApiKey    = keys.ParseApiKey;
            ApplicationId = keys.ParseApplicationKey;
        }
Ejemplo n.º 2
0
        protected virtual IAmazonS3 CreateAmazonS3Client(string bucketName, AmazonS3Config s3Config)
        {
            var accessKeys = AccessKeys.GetAccessKeys(bucketName);

            return(new AmazonS3Client(accessKeys.S3AccessKey,
                                      accessKeys.S3SecretAccessKey, s3Config));
        }
Ejemplo n.º 3
0
        public BloomParseClient()
        {
            _sessionToken = String.Empty;

            var keys = AccessKeys.GetAccessKeys(BookTransfer.UploadBucketNameForCurrentEnvironment);

            RestApiKey    = keys.ParseApiKey;
            ApplicationId = keys.ParseApplicationKey;
        }
Ejemplo n.º 4
0
        private IAmazonS3 GetAmazonS3(string bucketName)
        {
            //Note, it would probably be fine to just generate this each time,
            //but this was the more conservative approach when refactoring
            //to allow a single client to access arbitrary buckets, thus requiring
            //appropriate change of access keys, thus requiring changing AmazonS3Client objects.
            if (bucketName != _previousBucketName)
            {
                var accessKeys = AccessKeys.GetAccessKeys(bucketName);
                if (_amazonS3 != null)
                {
                    _amazonS3.Dispose();
                }
                _amazonS3 = new AmazonS3Client(accessKeys.S3AccessKey,
                                               accessKeys.S3SecretAccessKey, _s3Config);

                _previousBucketName = bucketName;
            }
            return(_amazonS3);            // we keep this so that we can dispose of it later.
        }