Ejemplo n.º 1
0
            public override bool Equals(object obj)
            {
                if (this == obj)
                {
                    return(true);
                }
                CacheKey cacheKey = obj as CacheKey;

                if (cacheKey == null)
                {
                    return(false);
                }
                return(AWSSDKUtils.AreEqual(new object[4]
                {
                    ImmutableCredentials,
                    RegionEndpoint,
                    ServiceUrl,
                    CacheType
                }, new object[4]
                {
                    cacheKey.ImmutableCredentials,
                    cacheKey.RegionEndpoint,
                    cacheKey.ServiceUrl,
                    cacheKey.CacheType
                }));
            }
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var po = obj as CredentialProfileOptions;

            if (po == null)
            {
                return(false);
            }

#if !BCL35 && !NETSTANDARD13
            return(AWSSDKUtils.AreEqual(
                       new object[] { AccessKey, EndpointName, ExternalID, MfaSerial, RoleArn, RoleSessionName, SecretKey, SourceProfile, Token, UserIdentity, CredentialProcess, WebIdentityTokenFile, SsoAccountId, SsoRegion, SsoRoleName, SsoStartUrl },
                       new object[] { po.AccessKey, po.EndpointName, po.ExternalID, po.MfaSerial, po.RoleArn, po.RoleSessionName, po.SecretKey, po.SourceProfile, po.Token, po.UserIdentity, po.CredentialProcess, po.WebIdentityTokenFile, SsoAccountId, SsoRegion, SsoRoleName, SsoStartUrl }));
#elif BCL35
            return(AWSSDKUtils.AreEqual(
                       new object[] { AccessKey, EndpointName, ExternalID, MfaSerial, RoleArn, RoleSessionName, SecretKey, SourceProfile, Token, UserIdentity, CredentialProcess, WebIdentityTokenFile },
                       new object[] { po.AccessKey, po.EndpointName, po.ExternalID, po.MfaSerial, po.RoleArn, po.RoleSessionName, po.SecretKey, po.SourceProfile, po.Token, po.UserIdentity, po.CredentialProcess, po.WebIdentityTokenFile }));
#else
            return(AWSSDKUtils.AreEqual(
                       new object[] { AccessKey, ExternalID, MfaSerial, RoleArn, RoleSessionName, SecretKey, SourceProfile, Token, CredentialProcess, WebIdentityTokenFile },
                       new object[] { po.AccessKey, po.ExternalID, po.MfaSerial, po.RoleArn, po.RoleSessionName, po.SecretKey, po.SourceProfile, po.Token, po.CredentialProcess, po.WebIdentityTokenFile }));
#endif
        }
Ejemplo n.º 3
0
 public static void Clear(object cacheType)
 {
     lock (cacheLock)
     {
         foreach (CacheKey key in cache.Keys)
         {
             if (AWSSDKUtils.AreEqual(key.CacheType, cacheType))
             {
                 cache.GetValue(key, null).Clear();
             }
         }
     }
 }
Ejemplo n.º 4
0
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var bac = obj as BasicAWSCredentials;

            if (bac == null)
            {
                return(false);
            }

            return(AWSSDKUtils.AreEqual(
                       new object[] { _credentials },
                       new object[] { bac._credentials }));
        }
Ejemplo n.º 5
0
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            AssumeRoleImmutableCredentials aric = obj as AssumeRoleImmutableCredentials;

            if (aric == null)
            {
                return(false);
            }

            return(AWSSDKUtils.AreEqual(
                       new object[] { AccessKey, SecretKey, Token, Expiration },
                       new object[] { aric.AccessKey, aric.SecretKey, aric.Token, Expiration }));
        }
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            ImmutableCredentials ic = obj as ImmutableCredentials;

            if (ic == null)
            {
                return(false);
            }

            return(AWSSDKUtils.AreEqual(
                       new object[] { AccessKey, SecretKey, Token },
                       new object[] { ic.AccessKey, ic.SecretKey, ic.Token }));
        }
Ejemplo n.º 7
0
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var sac = obj as SessionAWSCredentials;

            if (sac == null)
            {
                return(false);
            }

            return(AWSSDKUtils.AreEqual(
                       new object[] { _lastCredentials },
                       new object[] { sac._lastCredentials }));
        }
Ejemplo n.º 8
0
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            SSOImmutableCredentials ssoImmutableCredentials = obj as SSOImmutableCredentials;

            if (ssoImmutableCredentials == null)
            {
                return(false);
            }

            return(AWSSDKUtils.AreEqual(
                       new object[] { AccessKey, SecretKey, Token, Expiration },
                       new object[] { ssoImmutableCredentials.AccessKey, ssoImmutableCredentials.SecretKey, ssoImmutableCredentials.Token, Expiration }));
        }
Ejemplo n.º 9
0
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var p = obj as CredentialProfile;

            if (p == null)
            {
                return(false);
            }

            return(AWSSDKUtils.AreEqual(
                       new object[] { Name, Options, Region, ProfileType, CanCreateAWSCredentials, UniqueKey },
                       new object[] { p.Name, p.Options, p.Region, p.ProfileType, p.CanCreateAWSCredentials, p.UniqueKey }) &&
                   AWSSDKUtils.DictionariesAreEqual(Properties, p.Properties));
        }
Ejemplo n.º 10
0
            public override bool Equals(object obj)
            {
                if (object.ReferenceEquals(this, obj))
                {
                    return(true);
                }

                CacheKey ck = obj as CacheKey;

                if (ck == null)
                {
                    return(false);
                }

                var allEqual = AWSSDKUtils.AreEqual(
                    new object[] { this.ImmutableCredentials, this.RegionEndpoint, this.ServiceUrl, this.CacheType },
                    new object[] { ck.ImmutableCredentials, ck.RegionEndpoint, ck.ServiceUrl, ck.CacheType });

                return(allEqual);
            }
Ejemplo n.º 11
0
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var po = obj as CredentialProfileOptions;

            if (po == null)
            {
                return(false);
            }

#if BCL
            return(AWSSDKUtils.AreEqual(
                       new object[] { AccessKey, EndpointName, ExternalID, MfaSerial, RoleArn, SecretKey, SourceProfile, Token, UserIdentity },
                       new object[] { po.AccessKey, po.EndpointName, po.ExternalID, po.MfaSerial, po.RoleArn, po.SecretKey, po.SourceProfile, po.Token, po.UserIdentity }));
#else
            return(AWSSDKUtils.AreEqual(
                       new object[] { AccessKey, ExternalID, MfaSerial, RoleArn, SecretKey, SourceProfile, Token },
                       new object[] { po.AccessKey, po.ExternalID, po.MfaSerial, po.RoleArn, po.SecretKey, po.SourceProfile, po.Token }));
#endif
        }
Ejemplo n.º 12
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            ImmutableCredentials immutableCredentials = obj as ImmutableCredentials;

            if (immutableCredentials == null)
            {
                return(false);
            }
            return(AWSSDKUtils.AreEqual(new object[3]
            {
                AccessKey,
                SecretKey,
                Token
            }, new object[3]
            {
                immutableCredentials.AccessKey,
                immutableCredentials.SecretKey,
                immutableCredentials.Token
            }));
        }