import React from 'react'; import get from 'lodash/get'; import { useDispatch } from 'react-redux'; import AuthMode from './AuthMode'; import AwsV4Auth from './AwsV4Auth'; import BearerAuth from './BearerAuth'; import BasicAuth from './BasicAuth'; import DigestAuth from './DigestAuth'; import WsseAuth from './WsseAuth'; import ApiKeyAuth from './ApiKeyAuth/'; import EdgeGridAuth from './EdgeGridAuth'; import { saveCollectionSettings } from 'providers/ReduxStore/slices/collections/actions'; import StyledWrapper from './StyledWrapper'; import OAuth2 from './OAuth2'; import NTLMAuth from './NTLMAuth'; import OAuth1 from './Oauth1'; import Button from 'ui/Button'; const Auth = ({ collection }) => { const authMode = collection.draft?.root ? get(collection, 'draft.root.request.auth.mode') : get(collection, 'root.request.auth.mode'); const dispatch = useDispatch(); const handleSave = () => dispatch(saveCollectionSettings(collection.uid)); const getAuthView = () => { switch (authMode) { case 'awsv4': { return ; } case 'basic': { return ; } case 'bearer': { return ; } case 'digest': { return ; } case 'ntlm': { return ; } case 'oauth1': { return ; } case 'oauth2': { return ; } case 'wsse': { return ; } case 'apikey': { return ; } case 'akamai-edgegrid': { return ; } } }; return ( Configures authentication for the entire collection. This applies to all requests using the{' '} Inherit option in the Auth tab. {getAuthView()} Save ); }; export default Auth;