github.com/akamai/AkamaiOPEN-edgegrid-golang/v4@v4.1.0/pkg/appsec/appsec.go (about)

     1  // Package appsec provides access to the Akamai Application Security APIs
     2  package appsec
     3  
     4  import (
     5  	"errors"
     6  
     7  	"github.com/akamai/AkamaiOPEN-edgegrid-golang/v4/pkg/session"
     8  )
     9  
    10  var (
    11  	// ErrStructValidation is returned returned when given struct validation failed
    12  	ErrStructValidation = errors.New("struct validation")
    13  )
    14  
    15  type (
    16  	// APPSEC is the appsec api interface
    17  	APPSEC interface {
    18  		Activations
    19  		AdvancedSettingsAttackPayloadLogging
    20  		AdvancedSettingsEvasivePathMatch
    21  		AdvancedSettingsLogging
    22  		AdvancedSettingsPragma
    23  		AdvancedSettingsPrefetch
    24  		ApiConstraintsProtection
    25  		ApiEndpoints
    26  		ApiHostnameCoverage
    27  		ApiHostnameCoverageMatchTargets
    28  		ApiHostnameCoverageOverlapping
    29  		ApiRequestConstraints
    30  		AttackGroup
    31  		BypassNetworkLists
    32  		Configuration
    33  		ConfigurationClone
    34  		ConfigurationVersion
    35  		ConfigurationVersionClone
    36  		ContractsGroups
    37  		CustomDeny
    38  		CustomRule
    39  		CustomRuleAction
    40  		Eval
    41  		EvalGroup
    42  		EvalHost
    43  		EvalPenaltyBox
    44  		EvalProtectHost
    45  		EvalRule
    46  		ExportConfiguration
    47  		FailoverHostnames
    48  		IPGeo
    49  		IPGeoProtection
    50  		MalwareContentTypes
    51  		MalwarePolicy
    52  		MalwarePolicyAction
    53  		MalwareProtection
    54  		MatchTarget
    55  		MatchTargetSequence
    56  		NetworkLayerProtection
    57  		PenaltyBox
    58  		PolicyProtections
    59  		RatePolicy
    60  		RatePolicyAction
    61  		RateProtection
    62  		ReputationAnalysis
    63  		ReputationProfile
    64  		ReputationProfileAction
    65  		ReputationProtection
    66  		Rule
    67  		RuleUpgrade
    68  		SecurityPolicy
    69  		SecurityPolicyClone
    70  		SelectableHostnames
    71  		SelectedHostname
    72  		SiemDefinitions
    73  		SiemSettings
    74  		SlowPostProtection
    75  		SlowPostProtectionSetting
    76  		ThreatIntel
    77  		TuningRecommendations
    78  		VersionNotes
    79  		WAFMode
    80  		WAFProtection
    81  		WAPBypassNetworkLists
    82  		WAPSelectedHostnames
    83  	}
    84  
    85  	appsec struct {
    86  		session.Session
    87  	}
    88  
    89  	// Option defines a PAPI option
    90  	Option func(*appsec)
    91  
    92  	// ClientFunc is a appsec client new method, this can used for mocking
    93  	ClientFunc func(sess session.Session, opts ...Option) APPSEC
    94  )
    95  
    96  // Client returns a new appsec Client instance with the specified controller
    97  func Client(sess session.Session, opts ...Option) APPSEC {
    98  	p := &appsec{
    99  		Session: sess,
   100  	}
   101  
   102  	for _, opt := range opts {
   103  		opt(p)
   104  	}
   105  	return p
   106  }