code: func Security(scheme interface{}, dsl ...func()) {
  	var def *design.SecurityDefinition
  	switch val := scheme.(type) {
  	case string:
  		def = &design.SecurityDefinition{}
  		for _, scheme := range design.Design.SecuritySchemes {
  			if scheme.SchemeName == val {
  				def.Scheme = scheme
  			}
  		}
  		if def.Scheme == nil {
  			dslengine.ReportError("security scheme %q not found", val)
  			return
  		}
  	case *design.SecuritySchemeDefinition:
  		def = &design.SecurityDefinition{Scheme: val}
  	default:
  		dslengine.ReportError("invalid value for 'scheme' parameter, specify a string or a *SecuritySchemeDefinition")
  		return
  	}
  
  	if len(dsl) != 0 {
  		if !dslengine.Execute(dsl[0], def) {
  			return
  		}
  	}
  
  	parentDef := dslengine.CurrentDefinition()
  	switch parent := parentDef.(type) {
  	case *design.ActionDefinition:
  		parent.Security = def
  	case *design.FileServerDefinition:
  		parent.Security = def
  	case *design.ResourceDefinition:
  		parent.Security = def
  	case *design.APIDefinition:
  		parent.Security = def
  	default:
  		dslengine.IncompatibleDSL()
  		return
  	}
  }
docs: // Security can be used in: API, Action, Files, Resource
  //
  // Security defines an authentication requirements to access a goa Action.  When defined on a
  // Resource, it applies to all Actions, unless overriden by individual actions.  When defined at the
  // API level, it will apply to all resources by default, following the same logic.
  //
  // The scheme refers to previous definitions of either OAuth2Security, BasicAuthSecurity,
  // APIKeySecurity or JWTSecurity.  It can be a string, corresponding to the first parameter of
  // those definitions, or a SecuritySchemeDefinition, returned by those same functions. Examples:
  //
  //    Security(BasicAuth)
  //
  //    Security("oauth2", func() {
  //        Scope("api:read")  // Requires "api:read" oauth2 scope
  //    })
  //