├── .github └── FUNDING.yml ├── pfSense-pkg-RESTAPI ├── pkg-descr └── files │ └── usr │ └── local │ ├── pkg │ └── RESTAPI │ │ ├── .resources │ │ ├── cache │ │ │ └── README.md │ │ ├── vendor │ │ │ └── README.md │ │ ├── schemas │ │ │ └── README.md │ │ └── scripts │ │ │ └── dispatch.sh │ │ ├── Dispatchers │ │ ├── VirtualIPApplyDispatcher.inc │ │ ├── DHCPServerApplyDispatcher.inc │ │ ├── SystemRebootDispatcher.inc │ │ ├── SystemHaltDispatcher.inc │ │ ├── WebGUIRestartDispatcher.inc │ │ ├── FirewallApplyDispatcher.inc │ │ ├── RESTAPISettingsSyncDispatcher.inc │ │ ├── BINDApplyDispatcher.inc │ │ ├── DNSForwarderApplyDispatcher.inc │ │ ├── TrafficShaperApplyDispatcher.inc │ │ ├── DNSResolverApplyDispatcher.inc │ │ ├── IPsecApplyDispatcher.inc │ │ └── FirewallStateTableResetDispatcher.inc │ │ ├── Tests │ │ ├── APIModelsAuthLogTestCase.inc │ │ ├── APIModelsSystemHaltTestCase.inc │ │ ├── APIModelsDHCPLogTestCase.inc │ │ ├── APIModelsSystemRebootTestCase.inc │ │ ├── APIModelsSystemLogTestCase.inc │ │ ├── APIModelsFirewallLogTestCase.inc │ │ ├── APIModelsOpenVPNLogTestCase.inc │ │ ├── assets │ │ │ ├── test_openvpn_tls.key │ │ │ └── test_x509_crl.crl │ │ ├── APIQueryFiltersLessThanQueryFilterTestCase.inc │ │ ├── APIModelsBINDSyncSettingsTestCase.inc │ │ ├── APIQueryFiltersExactQueryFilterTestCase.inc │ │ ├── APIQueryFiltersExceptQueryFilterTestCase.inc │ │ ├── APIResponsesSuccessTestCase.inc │ │ ├── APIResponsesServerErrorTestCase.inc │ │ ├── APICoreValidatorTestCase.inc │ │ ├── APIResponsesConflictErrorTestCase.inc │ │ ├── APIResponsesNotFoundErrorTestCase.inc │ │ ├── APIFieldsUIDFieldTestCase.inc │ │ ├── APIResponsesForbiddenErrorTestCase.inc │ │ ├── APIResponsesMediaTypeErrorTestCase.inc │ │ ├── APIResponsesValidationErrorTestCase.inc │ │ ├── APIQueryFiltersGreaterThanQueryFilterTestCase.inc │ │ ├── APIResponsesNotAcceptableErrorTestCase.inc │ │ ├── APIQueryFiltersLessThanEqualQueryFilterTestCase.inc │ │ ├── APIResponsesAuthenticationErrorTestCase.inc │ │ ├── APIQueryFiltersGreaterThanEqualQueryFilterTestCase.inc │ │ ├── APIResponsesFailedDependencyErrorTestCase.inc │ │ ├── APIModelsAvailableInterfaceTestCase.inc │ │ └── APIResponsesMethodNotAllowedErrorTestCase.inc │ │ ├── Core │ │ ├── Globals.inc │ │ └── TestCaseRetry.inc │ │ ├── Endpoints │ │ ├── UserEndpoint.inc │ │ ├── StatusCARPEndpoint.inc │ │ ├── StatusSystemEndpoint.inc │ │ ├── SystemVersionEndpoint.inc │ │ ├── RoutingApplyEndpoint.inc │ │ ├── AuthKeysEndpoint.inc │ │ ├── ServicesDHCPRelayEndpoint.inc │ │ ├── StatusIPsecSAEndpoint.inc │ │ ├── StatusLogsDHCPEndpoint.inc │ │ ├── SystemConsoleEndpoint.inc │ │ ├── UserGroupEndpoint.inc │ │ ├── StatusLogsAuthEndpoint.inc │ │ ├── AuthJWTEndpoint.inc │ │ ├── FirewallAliasEndpoint.inc │ │ ├── FirewallRuleEndpoint.inc │ │ ├── StatusLogsSystemEndpoint.inc │ │ ├── AuthKeyEndpoint.inc │ │ ├── InterfaceGREEndpoint.inc │ │ ├── ServicesNTPSettingsEndpoint.inc │ │ ├── StatusServicesEndpoint.inc │ │ ├── UsersEndpoint.inc │ │ ├── FirewallStatesSizeEndpoint.inc │ │ ├── InterfaceLAGGEndpoint.inc │ │ ├── InterfaceVLANEndpoint.inc │ │ ├── ServicesCronJobEndpoint.inc │ │ ├── StatusLogsOpenVPNEndpoint.inc │ │ ├── StatusLogsSettingsEndpoint.inc │ │ ├── SystemTunableEndpoint.inc │ │ ├── SystemWebGUISettingsEndpoint.inc │ │ ├── UserAuthServerEndpoint.inc │ │ ├── UserGroupsEndpoint.inc │ │ ├── VPNIPsecPhase1Endpoint.inc │ │ ├── VPNIPsecPhase2Endpoint.inc │ │ ├── InterfaceGroupEndpoint.inc │ │ ├── RoutingGatewayEndpoint.inc │ │ ├── ServicesBINDViewEndpoint.inc │ │ ├── ServicesBINDZoneEndpoint.inc │ │ ├── StatusIPsecChildSAEndpoint.inc │ │ ├── StatusLogsFirewallEndpoint.inc │ │ ├── SystemCRLEndpoint.inc │ │ ├── SystemRESTAPIVersionEndpoint.inc │ │ ├── DiagnosticsARPTableEntryEndpoint.inc │ │ ├── FirewallRulesEndpoint.inc │ │ ├── FirewallScheduleEndpoint.inc │ │ ├── FirewallVirtualIPEndpoint.inc │ │ ├── InterfaceBridgeEndpoint.inc │ │ ├── ServicesACMESettingsEndpoint.inc │ │ ├── ServicesBINDSettingsEndpoint.inc │ │ ├── StatusIPsecSAsEndpoint.inc │ │ ├── SystemCertificateEndpoint.inc │ │ ├── VPNOpenVPNServerEndpoint.inc │ │ ├── VPNWireGuardPeerEndpoint.inc │ │ ├── FirewallNATOutboundModeEndpoint.inc │ │ ├── InterfaceGREsEndpoint.inc │ │ ├── ServicesDHCPServerEndpoint.inc │ │ ├── StatusGatewaysEndpoint.inc │ │ ├── StatusInterfacesEndpoint.inc │ │ ├── SystemRESTAPISettingsEndpoint.inc │ │ ├── VPNOpenVPNClientEndpoint.inc │ │ ├── VPNWireGuardSettingsEndpoint.inc │ │ ├── DiagnosticsARPTableEndpoint.inc │ │ ├── FirewallAliasesEndpoint.inc │ │ ├── InterfaceBridgesEndpoint.inc │ │ ├── InterfaceLAGGsEndpoint.inc │ │ ├── InterfaceVLANsEndpoint.inc │ │ ├── ServicesHAProxyFileEndpoint.inc │ │ ├── ServicesHAProxySettingsEndpoint.inc │ │ ├── SystemTunablesEndpoint.inc │ │ ├── UserAuthServersEndpoint.inc │ │ ├── FirewallTrafficShaperEndpoint.inc │ │ ├── RoutingGatewaysEndpoint.inc │ │ ├── ServicesCronJobsEndpoint.inc │ │ ├── SystemCRLsEndpoint.inc │ │ ├── SystemCertificatesEndpoint.inc │ │ ├── VPNIPsecPhase1sEndpoint.inc │ │ ├── VPNIPsecPhase2sEndpoint.inc │ │ ├── FirewallNATPortForwardEndpoint.inc │ │ ├── FirewallSchedulesEndpoint.inc │ │ ├── FirewallVirtualIPsEndpoint.inc │ │ ├── InterfaceGroupsEndpoint.inc │ │ ├── ServicesBINDViewsEndpoint.inc │ │ ├── ServicesBINDZonesEndpoint.inc │ │ ├── ServicesDHCPServersEndpoint.inc │ │ ├── ServicesHAProxyFiles.inc │ │ ├── VPNOpenVPNCSOEndpoint.inc │ │ ├── VPNOpenVPNClientsEndpoint.inc │ │ ├── VPNOpenVPNServersEndpoint.inc │ │ ├── VPNWireGuardTunnelEndpoint.inc │ │ ├── RoutingGatewayGroupEndpoint.inc │ │ ├── ServicesACMECertificateEndpoint.inc │ │ ├── ServicesBINDSyncSettingsEndpoint.inc │ │ ├── ServicesNTPTimeServerEndpoint.inc │ │ ├── VPNWireGuardPeersEndpoint.inc │ │ ├── ServicesBINDAccessListEndpoint.inc │ │ ├── ServicesBINDZoneRecordEndpoint.inc │ │ ├── ServicesHAProxyBackendEndpoint.inc │ │ ├── StatusOpenVPNServerRouteEndpoint.inc │ │ ├── DiagnosticsRebootEndpoint.inc │ │ ├── ServicesDNSResolverSettingsEndpoint.inc │ │ ├── ServicesHAProxyFrontendEndpoint.inc │ │ ├── ServicesServiceWatchdogEndpoint.inc │ │ ├── StatusOpenVPNClientsEndpoint.inc │ │ ├── SystemPackageAvailableEndpoint.inc │ │ ├── FirewallAdvancedSettingsEndpoint.inc │ │ ├── FirewallNATPortForwardsEndpoint.inc │ │ ├── FirewallTrafficShapersEndpoint.inc │ │ ├── NetworkInterfaceEndpoint.inc │ │ ├── RoutingGatewayDefaultEndpoint.inc │ │ ├── StatusOpenVPNServersEndpoint.inc │ │ ├── VPNOpenVPNCSOsEndpoint.inc │ │ ├── VPNWireGuardTunnelsEndpoint.inc │ │ ├── FirewallNATOneToOneMappingEndpoint.inc │ │ ├── RoutingGatewayGroupsEndpoint.inc │ │ ├── RoutingStaticRouteEndpoint.inc │ │ ├── StatusDHCPServerLeasesEndpoint.inc │ │ ├── DiagnosticsHaltSystemEndpoint.inc │ │ ├── NetworkInterfacesEndpoint.inc │ │ ├── ServicesACMECertificatesEndpoint.inc │ │ ├── ServicesHAProxyBackendACLEndpoint.inc │ │ ├── ServicesNTPTimeServersEndpoint.inc │ │ ├── StatusServiceEndpoint.inc │ │ ├── FirewallNATOutboundMappingEndpoint.inc │ │ ├── FirewallTrafficShaperQueueEndpoint.inc │ │ ├── ServicesFreeRADIUSClientsEndpoint.inc │ │ ├── ServicesHAProxyBackendsEndpoint.inc │ │ ├── ServicesHAProxyFrontendACLEndpoint.inc │ │ ├── SystemRESTAPIAccessListEndpoint.inc │ │ ├── VPNIPsecPhase1EncryptionEndpoint.inc │ │ ├── VPNIPsecPhase2EncryptionEndpoint.inc │ │ ├── InterfaceAvailableInterfacesEndpoint.inc │ │ ├── ServicesBINDAccessListsEndpoint.inc │ │ ├── ServicesBINDSyncRemoteHostEndpoint.inc │ │ ├── ServicesHAProxyFrontendsEndpoint.inc │ │ ├── ServicesServiceWatchdogsEndpoint.inc │ │ ├── SystemCertificateAuthorityEndpoint.inc │ │ ├── SystemCertificateSigningRequestEndpoint.inc │ │ ├── SystemNotificationsEmailSettingsEndpoint.inc │ │ ├── SystemPackagesEndpoint.inc │ │ ├── VPNWireGuardPeerAllowedIPEndpoint.inc │ │ ├── VPNWireGuardTunnelAddressEndpoint.inc │ │ ├── DiagnosticsCommandPromptEndpoint.inc │ │ ├── FirewallScheduleTimeRangeEndpoint.inc │ │ ├── RoutingStaticRoutesEndpoint.inc │ │ ├── ServicesBINDAccessListEntryEndpoint.inc │ │ ├── ServicesFreeRADIUSClientEndpoint.inc │ │ ├── SystemRESTAPIAccessListEntryEndpoint.inc │ │ ├── FirewallNATOutboundMappingsEndpoint.inc │ │ ├── FirewallTrafficShaperLimiterEndpoint.inc │ │ ├── ServicesACMECertificateActionEndpoint.inc │ │ ├── ServicesACMECertificateDomainEndpoint.inc │ │ ├── ServicesFreeRADIUSInterfacesEndpoint.inc │ │ ├── ServicesHAProxyBackendActionEndpoint.inc │ │ ├── ServicesHAProxyBackendServerEndpoint.inc │ │ ├── ServicesWakeOnLANSendEndpoint.inc │ │ ├── FirewallNATOneToOneMappingsEndpoint.inc │ │ ├── RoutingGatewayGroupPriorityEndpoint.inc │ │ ├── ServicesDHCPServerAddressPoolEndpoint.inc │ │ ├── ServicesDNSResolverAccessListEndpoint.inc │ │ ├── ServicesHAProxyFrontendActionEndpoint.inc │ │ ├── FirewallTrafficShaperLimitersEndpoint.inc │ │ ├── ServicesBINDSyncRemoteHostsEndpoint.inc │ │ ├── ServicesDHCPServerCustomOptionEndpoint.inc │ │ ├── ServicesFreeRADIUSInterfaceEndpoint.inc │ │ ├── ServicesHAProxyFrontendAddressEndpoint.inc │ │ ├── SystemCertificateAuthoritiesEndpoint.inc │ │ ├── ServicesDHCPServerBackendEndpoint.inc │ │ ├── ServicesDHCPServerStaticMappingEndpoint.inc │ │ ├── ServicesDNSResolverHostOverrideEndpoint.inc │ │ ├── ServicesFreeRADIUSUsersEndpoint.inc │ │ ├── ServicesHAProxyBackendErrorFileEndpoint.inc │ │ ├── ServicesHAProxySettingsDNSResolverEndpoint.inc │ │ ├── ServicesHAProxySettingsEmailMailerEndpoint.inc │ │ ├── DiagnosticsConfigHistoryRevisionsEndpoint.inc │ │ ├── ServicesDNSForwarderHostOverrideEndpoint.inc │ │ ├── ServicesFreeRADIUSUserEndpoint.inc │ │ ├── ServicesHAProxyFrontendErrorFileEndpoint.inc │ │ ├── ServicesSSHEndpoint.inc │ │ ├── FirewallTrafficShaperLimiterQueueEndpoint.inc │ │ ├── ServicesDNSResolverAccessListsEndpoint.inc │ │ ├── ServicesDNSResolverDomainOverrideEndpoint.inc │ │ ├── SystemDNSEndpoint.inc │ │ ├── VPNIPsecApplyEndpoint.inc │ │ ├── VPNOpenVPNClientExportConfigEndpoint.inc │ │ ├── VPNOpenVPNClientExportConfigsEndpoint.inc │ │ ├── ServicesHAProxyFrontendCertificateEndpoint.inc │ │ ├── FirewallApplyEndpoint.inc │ │ ├── ServicesDNSResolverHostOverridesEndpoint.inc │ │ ├── SystemCRLRevokedCertificateEndpoint.inc │ │ ├── SystemCertificateRenewEndpoint.inc │ │ ├── InterfaceApplyEndpoint.inc │ │ ├── ServicesDNSForwarderHostOverridesEndpoint.inc │ │ ├── SystemHostnameEndpoint.inc │ │ └── SystemTimezoneEndpoint.inc │ │ └── Caches │ │ └── AvailablePackageCache.inc │ └── www │ └── api │ └── swagger │ ├── index.css │ └── swagger-initializer.js ├── .spectral.yml ├── requirements.txt ├── .phplint.yml ├── composer.json ├── .prettierignore ├── tools └── templates │ ├── pkg-plist.j2 │ └── Makefile.j2 ├── package.json ├── .gitignore ├── .pylintrc ├── .prettierrc └── docs └── ADVANCED_TOPICS_INTRO.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: jaredhendrickson13 2 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/pkg-descr: -------------------------------------------------------------------------------- 1 | The missing REST API package for pfSense. 2 | -------------------------------------------------------------------------------- /.spectral.yml: -------------------------------------------------------------------------------- 1 | extends: "spectral:oas" 2 | rules: 3 | oas3-unused-component: off 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | jinja2~=3.1.6 2 | pylint~=4.0.4 3 | black~=25.11.0 4 | mkdocs~=1.6.1 5 | -------------------------------------------------------------------------------- /.phplint.yml: -------------------------------------------------------------------------------- 1 | paths: 2 | - "pfSense-pkg-RESTAPI/files" 3 | extensions: 4 | - "inc" 5 | - "php" 6 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "firebase/php-jwt": "v6.11.*", 4 | "webonyx/graphql-php": "^15.13" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | pfSense-pkg-RESTAPI/files/usr/local/www/api/swagger/* 2 | pfSense-pkg-RESTAPI/files/usr/local/www/api/v2/documentation/* 3 | docs/* 4 | -------------------------------------------------------------------------------- /tools/templates/pkg-plist.j2: -------------------------------------------------------------------------------- 1 | {% for dir in files["dir"] -%} 2 | @dir {{ dir }} 3 | {% endfor %} 4 | {% for file in files["file"] -%} 5 | {{ file }} 6 | {% endfor %} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "prettier": "^3.7.3", 4 | "@prettier/plugin-php": "^0.24.0", 5 | "@stoplight/spectral-cli": "^6.15.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | tests/e2e_test_framework/__pycache__/ 3 | *.DS_Store 4 | .phplint-cache 5 | *.pyc 6 | venv/ 7 | /vendor/ 8 | .vagrant 9 | *.pkg 10 | node_modules 11 | .phpdoc/ 12 | site/ 13 | /phpDocumentor.phar 14 | -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | # Tests require duplicate code and may contain many test cases that require many lines of code 3 | disable=duplicate-code,too-many-lines 4 | 5 | [FORMAT] 6 | # Follow normal pep8 restriction 7 | max-line-length=120 8 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/.resources/cache/README.md: -------------------------------------------------------------------------------- 1 | # pfSense-pkg-RESTAPI Cache 2 | 3 | This directory contains cache files that are dynamically generated and refreshed by the pfSense-pkg-RESTAPI. Do not 4 | delete or modify this directory or any of its files manually. 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@prettier/plugin-php"], 3 | "overrides": [ 4 | { 5 | "files": ["*.inc", "*.php"], 6 | "options": { 7 | "parser": "php", 8 | "phpVersion": "8.2", 9 | "printWidth": 120, 10 | "singleQuote": true, 11 | "braceStyle": "1tbs" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/.resources/vendor/README.md: -------------------------------------------------------------------------------- 1 | # pfSense-pkg-RESTAPI Vendor Includes 2 | 3 | This directory contains the PHP dependencies for the pfSense-pkg-RESTAPI package. 4 | These dependencies are automatically installed via composer when the package is 5 | built. This directory will also contain the composer autoloader file. 6 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/www/api/swagger/index.css: -------------------------------------------------------------------------------- 1 | html { 2 | box-sizing: border-box; 3 | overflow: -moz-scrollbars-vertical; 4 | overflow-y: scroll; 5 | } 6 | 7 | *, 8 | *:before, 9 | *:after { 10 | box-sizing: inherit; 11 | } 12 | 13 | body { 14 | margin: 0; 15 | background: #fafafa; 16 | } 17 | 18 | .topbar { 19 | display: none; 20 | } 21 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/www/api/swagger/swagger-initializer.js: -------------------------------------------------------------------------------- 1 | window.onload = function() { 2 | window.ui = SwaggerUIBundle({ 3 | url: "/api/v2/schema/openapi", 4 | dom_id: '#swagger-ui', 5 | deepLinking: true, 6 | presets: [ 7 | SwaggerUIBundle.presets.apis, 8 | SwaggerUIStandalonePreset 9 | ], 10 | plugins: [ 11 | SwaggerUIBundle.plugins.DownloadUrl 12 | ], 13 | layout: "StandaloneLayout", 14 | validatorUrl: null 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/.resources/schemas/README.md: -------------------------------------------------------------------------------- 1 | # pfSense-pkg-RESTAPI Schemas 2 | 3 | This directory contains schema files that are used to represent the structure of the REST API responses in various 4 | formats. These schemas are typically used to generate documentation, or provide an alternative interface for interacting 5 | with the REST API. Schema files are populated by Schema classes found in `\RESTAPI\Schemas\`. 6 | 7 | Some common schema formats include: 8 | 9 | - OpenAPI 10 | - GraphQL 11 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Dispatchers/VirtualIPApplyDispatcher.inc: -------------------------------------------------------------------------------- 1 | model_objects as $auth_log) { 15 | $this->assert_is_not_empty($auth_log->text->value); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsSystemHaltTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_does_not_throw( 14 | callable: function () { 15 | (new SystemHalt(dry_run: true))->create(); 16 | }, 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsDHCPLogTestCase.inc: -------------------------------------------------------------------------------- 1 | model_objects as $dhcp_log) { 15 | $this->assert_is_not_empty($dhcp_log->text->value); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsSystemRebootTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_does_not_throw( 14 | callable: function () { 15 | (new SystemReboot(dry_run: true))->create(); 16 | }, 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Dispatchers/DHCPServerApplyDispatcher.inc: -------------------------------------------------------------------------------- 1 | model_objects as $system_log) { 15 | $this->assert_is_not_empty($system_log->text->value); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Dispatchers/SystemHaltDispatcher.inc: -------------------------------------------------------------------------------- 1 | async) { 16 | filter_configure(); 17 | } else { 18 | filter_configure_sync(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsFirewallLogTestCase.inc: -------------------------------------------------------------------------------- 1 | model_objects as $firewall_log) { 15 | $this->assert_is_not_empty($firewall_log->text->value); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Dispatchers/RESTAPISettingsSyncDispatcher.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/user'; 17 | $this->model_name = 'User'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/ADVANCED_TOPICS_INTRO.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | The package's framework is designed with modularity and extensibility at its core, 4 | enabling developers to craft custom components that enhance the API's functionality simply 5 | by writing PHP classes and dropping them into the appropriate directories. The following documents 6 | provide an overview of building various custom components for the REST API package: 7 | 8 | ## Pre-requisites 9 | 10 | - Familiarity with PHP programming and object-oriented programming (OOP) concepts. 11 | - A suitable development environment for both PHP and pfSense. 12 | - Fully read the [Contributing & Development guide](CONTRIBUTING.md) to understand the package's development workflow. -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusCARPEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/carp'; 17 | $this->model_name = 'CARP'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsOpenVPNLogTestCase.inc: -------------------------------------------------------------------------------- 1 | > /var/log/openvpn.log'); 15 | $openvpn_logs = OpenVPNLog::read_all(limit: 5); 16 | foreach ($openvpn_logs->model_objects as $openvpn_log) { 17 | $this->assert_is_not_empty($openvpn_log->text->value); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusSystemEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/system'; 17 | $this->model_name = 'SystemStatus'; 18 | $this->request_method_options = ['GET']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemVersionEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/version'; 17 | $this->model_name = 'SystemVersion'; 18 | $this->request_method_options = ['GET']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/TestCaseRetry.inc: -------------------------------------------------------------------------------- 1 | retries = max(0, $retries); 19 | $this->delay = max(0, $delay); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/RoutingApplyEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/routing/apply'; 17 | $this->model_name = 'RoutingApply'; 18 | $this->request_method_options = ['GET', 'POST']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/AuthKeysEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/auth/keys'; 16 | $this->model_name = 'RESTAPIKey'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDHCPRelayEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dhcp_relay'; 16 | $this->model_name = 'DHCPRelay'; 17 | $this->request_method_options = ['GET', 'PATCH']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusIPsecSAEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/ipsec/sas'; 17 | $this->model_name = 'IPsecSAStatus'; 18 | $this->request_method_options = ['GET']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusLogsDHCPEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/logs/dhcp'; 16 | $this->model_name = 'DHCPLog'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemConsoleEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/console'; 17 | $this->model_name = 'SystemConsole'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/UserGroupEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/user/group'; 17 | $this->model_name = 'UserGroup'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusLogsAuthEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/logs/auth'; 16 | $this->model_name = 'AuthLog'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/assets/test_openvpn_tls.key: -------------------------------------------------------------------------------- 1 | -----BEGIN OpenVPN Static key V1----- 2 | 57058a2f0ed144932c85d69d8b0eb6ed 3 | 3eea71275ad1451c51928af87fdc0ab4 4 | 4855f14d07d7495728783944adf13c51 5 | 013d66b2dc0a6a5158093ae91715bb82 6 | 9f1c03ee11d9eaf42da0e885baebc3ff 7 | 79dc6477c4cff1be1f1935cdb9d5b819 8 | 071397a26f7ec80c088ad4b5bfebef24 9 | 1ce0f3a24e2d4d43205104e23cc875cd 10 | c33444b9260d6bbea36b11daf78a9fd4 11 | 0573a34a0aabb51da065a4d0a5cd3cfd 12 | 4d82d23f5e385859ded83255fe08130b 13 | 99dd9cd26fb783f1f4d5014fd64b98ee 14 | 02d630bee0b872ffd4eac3f4d187eca8 15 | fbb3a9342bcb3f83641882b7c9866fa0 16 | c7a0badb3ebce179f7b6e6d9060ff88c 17 | f64084ddb251c7d600175304e4d87703 18 | -----END OpenVPN Static key V1----- 19 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Dispatchers/TrafficShaperApplyDispatcher.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/auth/jwt'; 16 | $this->model_name = 'RESTAPIJWT'; 17 | $this->auth_methods = ['BasicAuth']; 18 | $this->request_method_options = ['POST']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallAliasEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/alias'; 16 | $this->model_name = 'FirewallAlias'; 17 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallRuleEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/rule'; 16 | $this->model_name = 'FirewallRule'; 17 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusLogsSystemEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/logs/system'; 16 | $this->model_name = 'SystemLog'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/AuthKeyEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/auth/key'; 16 | $this->model_name = 'RESTAPIKey'; 17 | $this->auth_methods = ['BasicAuth']; 18 | $this->request_method_options = ['POST', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceGREEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/gre'; 17 | $this->model_name = 'InterfaceGRE'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesNTPSettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/ntp/settings'; 17 | $this->model_name = 'NTPSettings'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusServicesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/services'; 17 | $this->model_name = 'Service'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/UsersEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/users'; 17 | $this->model_name = 'User'; 18 | $this->tag = 'USER'; 19 | $this->many = true; 20 | $this->request_method_options = ['GET', 'DELETE']; 21 | 22 | # Construct the parent Endpoint object 23 | parent::__construct(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIQueryFiltersLessThanQueryFilterTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_is_true($query_filter->evaluate(1, 2)); 15 | $this->assert_is_true($query_filter->evaluate('1', '2')); 16 | $this->assert_is_false($query_filter->evaluate(2, 2)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallStatesSizeEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/states/size'; 16 | $this->model_name = 'FirewallStatesSize'; 17 | $this->request_method_options = ['GET', 'PATCH']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceLAGGEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/lagg'; 17 | $this->model_name = 'InterfaceLAGG'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceVLANEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/vlan'; 17 | $this->model_name = 'InterfaceVLAN'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesCronJobEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/cron/job'; 17 | $this->model_name = 'CronJob'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusLogsOpenVPNEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/logs/openvpn'; 16 | $this->model_name = 'OpenVPNLog'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusLogsSettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/logs/settings'; 17 | $this->model_name = 'LogSettings'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemTunableEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/tunable'; 17 | $this->model_name = 'SystemTunable'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemWebGUISettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/webgui/settings'; 16 | $this->model_name = 'WebGUISettings'; 17 | $this->request_method_options = ['GET', 'PATCH']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/UserAuthServerEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/user/auth_server'; 17 | $this->model_name = 'AuthServer'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/UserGroupsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/user/groups'; 17 | $this->model_name = 'UserGroup'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNIPsecPhase1Endpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/ipsec/phase1'; 17 | $this->model_name = 'IPsecPhase1'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNIPsecPhase2Endpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/ipsec/phase2'; 17 | $this->model_name = 'IPsecPhase2'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsBINDSyncSettingsTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_does_not_throw( 16 | callable: function () { 17 | $sync = new BINDSyncSettings(synconchanges: 'manual', synctimeout: 60, masterip: '1.2.3.4'); 18 | $sync->update(); 19 | }, 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceGroupEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/group'; 17 | $this->model_name = 'InterfaceGroup'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/RoutingGatewayEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/routing/gateway'; 17 | $this->model_name = 'RoutingGateway'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDViewEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/view'; 17 | $this->model_name = 'BINDView'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDZoneEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/zone'; 17 | $this->model_name = 'BINDZone'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusIPsecChildSAEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/ipsec/child_sa'; 17 | $this->model_name = 'IPsecChildSAStatus'; 18 | $this->request_method_options = ['GET']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusLogsFirewallEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/logs/firewall'; 16 | $this->model_name = 'FirewallLog'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemCRLEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/crl'; 17 | $this->model_name = 'CertificateRevocationList'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemRESTAPIVersionEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/restapi/version'; 17 | $this->model_name = 'RESTAPIVersion'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/DiagnosticsARPTableEntryEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/diagnostics/arp_table/entry'; 16 | $this->model_name = 'ARPTable'; 17 | $this->request_method_options = ['GET', 'DELETE']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallRulesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/rules'; 16 | $this->model_name = 'FirewallRule'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallScheduleEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/schedule'; 16 | $this->model_name = 'FirewallSchedule'; 17 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallVirtualIPEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/virtual_ip'; 17 | $this->model_name = 'VirtualIP'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceBridgeEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/bridge'; 17 | $this->model_name = 'InterfaceBridge'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesACMESettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/acme/settings'; 17 | $this->model_name = 'ACMESettings'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDSettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/settings'; 17 | $this->model_name = 'BINDSettings'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusIPsecSAsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/ipsec/sas'; 17 | $this->model_name = 'IPsecSAStatus'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemCertificateEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/certificate'; 17 | $this->model_name = 'Certificate'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNOpenVPNServerEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/openvpn/server'; 17 | $this->model_name = 'OpenVPNServer'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNWireGuardPeerEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/wireguard/peer'; 17 | $this->model_name = 'WireGuardPeer'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIQueryFiltersExactQueryFilterTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_is_true($query_filter->evaluate('test', 'test')); 15 | $this->assert_is_false($query_filter->evaluate('test', 'test2')); 16 | $this->assert_is_false($query_filter->evaluate(0, null)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIQueryFiltersExceptQueryFilterTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_is_true($query_filter->evaluate('test', 'test2')); 15 | $this->assert_is_true($query_filter->evaluate(0, null)); 16 | $this->assert_is_false($query_filter->evaluate('test', 'test')); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Caches/AvailablePackageCache.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/nat/outbound/mode'; 16 | $this->model_name = 'OutboundNATMode'; 17 | $this->request_method_options = ['GET', 'PATCH']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceGREsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/gres'; 17 | $this->model_name = 'InterfaceGRE'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDHCPServerEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dhcp_server'; 17 | $this->model_name = 'DHCPServer'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusGatewaysEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/gateways'; 17 | $this->model_name = 'RoutingGatewayStatus'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusInterfacesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/interfaces'; 17 | $this->model_name = 'InterfaceStats'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemRESTAPISettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/restapi/settings'; 17 | $this->model_name = 'RESTAPISettings'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNOpenVPNClientEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/openvpn/client'; 17 | $this->model_name = 'OpenVPNClient'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNWireGuardSettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/wireguard/settings'; 17 | $this->model_name = 'WireGuardSettings'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/DiagnosticsARPTableEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/diagnostics/arp_table'; 16 | $this->model_name = 'ARPTable'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallAliasesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/aliases'; 16 | $this->model_name = 'FirewallAlias'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceBridgesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/bridges'; 17 | $this->model_name = 'InterfaceBridge'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceLAGGsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/laggs'; 17 | $this->model_name = 'InterfaceLAGG'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceVLANsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/vlans'; 17 | $this->model_name = 'InterfaceVLAN'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyFileEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/file'; 17 | $this->model_name = 'HAProxyFile'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxySettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/settings'; 17 | $this->model_name = 'HAProxySettings'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemTunablesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/tunables'; 17 | $this->model_name = 'SystemTunable'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/UserAuthServersEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/user/auth_servers'; 17 | $this->model_name = 'AuthServer'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Dispatchers/DNSResolverApplyDispatcher.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/traffic_shaper'; 16 | $this->model_name = 'TrafficShaper'; 17 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/RoutingGatewaysEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/routing/gateways'; 17 | $this->model_name = 'RoutingGateway'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesCronJobsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/cron/jobs'; 17 | $this->model_name = 'CronJob'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemCRLsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/crls'; 17 | $this->model_name = 'CertificateRevocationList'; 18 | $this->request_method_options = ['GET', 'DELETE']; 19 | $this->many = true; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemCertificatesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/certificates'; 17 | $this->model_name = 'Certificate'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNIPsecPhase1sEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/ipsec/phase1s'; 17 | $this->model_name = 'IPsecPhase1'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNIPsecPhase2sEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/ipsec/phase2s'; 17 | $this->model_name = 'IPsecPhase2'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIResponsesSuccessTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 16 | response_id: 'TEST_SUCCESS', 17 | code: 200, 18 | callable: function () { 19 | throw new Success(message: 'test success', response_id: 'TEST_SUCCESS'); 20 | }, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallNATPortForwardEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/nat/port_forward'; 16 | $this->model_name = 'PortForward'; 17 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallSchedulesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/schedules'; 16 | $this->model_name = 'FirewallSchedule'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallVirtualIPsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/virtual_ips'; 17 | $this->many = true; 18 | $this->model_name = 'VirtualIP'; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceGroupsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/groups'; 17 | $this->model_name = 'InterfaceGroup'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDViewsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/views'; 17 | $this->model_name = 'BINDView'; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | $this->many = true; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDZonesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/zones'; 17 | $this->model_name = 'BINDZone'; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | $this->many = true; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDHCPServersEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dhcp_servers'; 17 | $this->model_name = 'DHCPServer'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyFiles.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/files'; 17 | $this->model_name = 'HAProxyFile'; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | $this->many = true; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNOpenVPNCSOEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/openvpn/cso'; 17 | $this->model_name = 'OpenVPNClientSpecificOverride'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNOpenVPNClientsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/openvpn/clients'; 17 | $this->model_name = 'OpenVPNClient'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNOpenVPNServersEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/openvpn/servers'; 17 | $this->model_name = 'OpenVPNServer'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNWireGuardTunnelEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/wireguard/tunnel'; 17 | $this->model_name = 'WireGuardTunnel'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/RoutingGatewayGroupEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/routing/gateway/group'; 17 | $this->model_name = 'RoutingGatewayGroup'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesACMECertificateEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/acme/certificate'; 16 | $this->model_name = 'ACMECertificate'; 17 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDSyncSettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/sync/settings'; 17 | $this->model_name = 'BINDSyncSettings'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesNTPTimeServerEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/ntp/time_server'; 17 | $this->model_name = 'NTPTimeServer'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNWireGuardPeersEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/wireguard/peers'; 17 | $this->model_name = 'WireGuardPeer'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDAccessListEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/access_list'; 17 | $this->model_name = 'BINDAccessList'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDZoneRecordEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/zone/record'; 17 | $this->model_name = 'BINDZoneRecord'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyBackendEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/backend'; 17 | $this->model_name = 'HAProxyBackend'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusOpenVPNServerRouteEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/openvpn/server/route'; 17 | $this->model_name = 'OpenVPNServerRouteStatus'; 18 | $this->request_method_options = ['GET']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/assets/test_x509_crl.crl: -------------------------------------------------------------------------------- 1 | -----BEGIN X509 CRL----- 2 | MIIB2jCBwwIBATANBgkqhkiG9w0BAQUFADAWMRQwEgYDVQQDEwtpbnRlcm5hbC1j 3 | YRcNMjQwNDI0MjIwMjE1WhcNMjYwNDI0MjIwMjE1WjAiMCACAQIXDTI0MDQyNDIy 4 | MDIxNVowDDAKBgNVHRUEAwoBCaBVMFMwRQYDVR0jBD4wPIAUJUzC5CblbCq8FU3k 5 | hWe8eqZlPZehGqQYMBYxFDASBgNVBAMTC2ludGVybmFsLWNhgggtyC2VhQuYKjAK 6 | BgNVHRQEAwIBAzANBgkqhkiG9w0BAQUFAAOCAQEAXqs/3gBtZFxt5sKVj/ek1N1J 7 | tAFEc18IMOaWVpc+HasQ5Kvi04ygfE0BWq5oXT9xi7aQfLZLHV2kpk8thdo8DMRo 8 | ezyZg2VnwovVPwmV/TnpXsRehBvo4pXXVq+REIhKLQW1SgfqfftEhEe0B2B5eK0U 9 | IVN7BoJK2k0uypahNxUR1ob1LXtr74j1nfH5wLLF6nitwX6ujj2O9ge6zAQS8eBN 10 | sJ2heugpAOP3tLQrMgGw6M9XBPjVBsnErVgRu11OJnUttL7kUgWcrTlaOYhPqvYx 11 | O2KYIqqr1w7O0epy0oKKZSHlwQoIOy8S1CNCIrFiYx4BJ9Gq34cjZ/OpkQPijQ== 12 | -----END X509 CRL----- 13 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/DiagnosticsRebootEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/diagnostics/reboot'; 16 | $this->model_name = 'SystemReboot'; 17 | $this->request_method_options = ['POST']; 18 | $this->post_help_text = 'Initiates a System Reboot.'; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDNSResolverSettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dns_resolver/settings'; 17 | $this->model_name = 'DNSResolverSettings'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyFrontendEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/frontend'; 17 | $this->model_name = 'HAProxyFrontend'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesServiceWatchdogEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/service_watchdog'; 17 | $this->model_name = 'ServiceWatchdog'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusOpenVPNClientsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/openvpn/clients'; 17 | $this->model_name = 'OpenVPNClientStatus'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemPackageAvailableEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/package/available'; 17 | $this->model_name = 'AvailablePackage'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIResponsesServerErrorTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 16 | response_id: 'TEST_ERROR', 17 | code: 500, 18 | callable: function () { 19 | throw new ServerError(message: 'test error', response_id: 'TEST_ERROR'); 20 | }, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallAdvancedSettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/advanced_settings'; 17 | $this->model_name = 'FirewallAdvancedSettings'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallNATPortForwardsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/nat/port_forwards'; 16 | $this->model_name = 'PortForward'; 17 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 18 | $this->many = true; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallTrafficShapersEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/traffic_shapers'; 16 | $this->model_name = 'TrafficShaper'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/NetworkInterfaceEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface'; 17 | $this->model_name = 'NetworkInterface'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/RoutingGatewayDefaultEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/routing/gateway/default'; 17 | $this->model_name = 'DefaultGateway'; 18 | $this->tag = 'ROUTING'; 19 | $this->request_method_options = ['GET', 'PATCH']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusOpenVPNServersEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/openvpn/servers'; 17 | $this->model_name = 'OpenVPNServerStatus'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNOpenVPNCSOsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/openvpn/csos'; 17 | $this->model_name = 'OpenVPNClientSpecificOverride'; 18 | $this->request_method_options = ['GET', 'DELETE']; 19 | $this->many = true; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNWireGuardTunnelsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/wireguard/tunnels'; 17 | $this->model_name = 'WireGuardTunnel'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APICoreValidatorTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 17 | response_id: 'VALIDATOR_INCOMPLETE', 18 | code: 500, 19 | callable: function () { 20 | (new RESTAPI\Core\Validator())->validate('test'); 21 | }, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallNATOneToOneMappingEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/nat/one_to_one/mapping'; 16 | $this->model_name = 'OneToOneNATMapping'; 17 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 18 | 19 | # Construct the parent Endpoint object 20 | parent::__construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/RoutingGatewayGroupsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/routing/gateway/groups'; 17 | $this->model_name = 'RoutingGatewayGroup'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/RoutingStaticRouteEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/routing/static_route'; 17 | $this->model_name = 'StaticRoute'; 18 | $this->tag = 'ROUTING'; 19 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusDHCPServerLeasesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/dhcp_server/leases'; 17 | $this->model_name = 'DHCPServerLease'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIResponsesConflictErrorTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 16 | response_id: 'TEST_ERROR', 17 | code: 409, 18 | callable: function () { 19 | throw new ConflictError(message: 'test error', response_id: 'TEST_ERROR'); 20 | }, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIResponsesNotFoundErrorTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 16 | response_id: 'TEST_ERROR', 17 | code: 404, 18 | callable: function () { 19 | throw new NotFoundError(message: 'test error', response_id: 'TEST_ERROR'); 20 | }, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/DiagnosticsHaltSystemEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/diagnostics/halt_system'; 16 | $this->model_name = 'SystemHalt'; 17 | $this->request_method_options = ['POST']; 18 | $this->post_help_text = 'Initiates a System Halt.'; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/NetworkInterfacesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interfaces'; 17 | $this->model_name = 'NetworkInterface'; 18 | $this->tag = 'INTERFACE'; 19 | $this->many = true; 20 | $this->request_method_options = ['GET', 'DELETE']; 21 | 22 | # Construct the parent Endpoint object 23 | parent::__construct(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesACMECertificatesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/acme/certificates'; 16 | $this->model_name = 'ACMECertificate'; 17 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 18 | $this->many = true; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyBackendACLEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/backend/acl'; 17 | $this->model_name = 'HAProxyBackendACL'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesNTPTimeServersEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/ntp/time_servers'; 17 | $this->model_name = 'NTPTimeServer'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/StatusServiceEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/status/service'; 17 | $this->model_name = 'Service'; 18 | $this->request_method_options = ['POST']; 19 | $this->post_help_text = 'Triggers a start, stop or restart action for an existing Service'; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIFieldsUIDFieldTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_not_equals($field1->default, $field2->default); 16 | } 17 | 18 | /** 19 | * Checks that the 'prefix' attributes works as intended. 20 | */ 21 | public function test_prefix(): void { 22 | $field = new UIDField(prefix: 'test-'); 23 | $this->assert_is_true(str_starts_with($field->default, 'test-')); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIResponsesForbiddenErrorTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 16 | response_id: 'TEST_ERROR', 17 | code: 403, 18 | callable: function () { 19 | throw new ForbiddenError(message: 'test error', response_id: 'TEST_ERROR'); 20 | }, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallNATOutboundMappingEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/nat/outbound/mapping'; 17 | $this->model_name = 'OutboundNATMapping'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallTrafficShaperQueueEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/traffic_shaper/queue'; 17 | $this->model_name = 'TrafficShaperQueue'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesFreeRADIUSClientsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/freeradius/clients'; 17 | $this->model_name = 'FreeRADIUSClient'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyBackendsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/backends'; 17 | $this->model_name = 'HAProxyBackend'; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | $this->many = true; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyFrontendACLEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/frontend/acl'; 17 | $this->model_name = 'HAProxyFrontendACL'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemRESTAPIAccessListEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/restapi/access_list'; 16 | $this->model_name = 'RESTAPIAccessListEntry'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNIPsecPhase1EncryptionEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/ipsec/phase1/encryption'; 17 | $this->model_name = 'IPsecPhase1Encryption'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNIPsecPhase2EncryptionEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/ipsec/phase2/encryption'; 17 | $this->model_name = 'IPsecPhase2Encryption'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIResponsesMediaTypeErrorTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 16 | response_id: 'TEST_ERROR', 17 | code: 415, 18 | callable: function () { 19 | throw new MediaTypeError(message: 'test error', response_id: 'TEST_ERROR'); 20 | }, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceAvailableInterfacesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/available_interfaces'; 17 | $this->model_name = 'AvailableInterface'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDAccessListsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/access_lists'; 17 | $this->model_name = 'BINDAccessList'; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | $this->many = true; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDSyncRemoteHostEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/sync/remote_host'; 17 | $this->model_name = 'BINDSyncRemoteHost'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyFrontendsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/frontends'; 17 | $this->model_name = 'HAProxyFrontend'; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | $this->many = true; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesServiceWatchdogsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/service_watchdogs'; 17 | $this->model_name = 'ServiceWatchdog'; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | $this->many = true; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemCertificateAuthorityEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/certificate_authority'; 17 | $this->model_name = 'CertificateAuthority'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemCertificateSigningRequestEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/certificate/signing_request'; 17 | $this->model_name = 'CertificateSigningRequest'; 18 | $this->request_method_options = ['POST']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemNotificationsEmailSettingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/notifications/email_settings'; 17 | $this->model_name = 'EmailNotificationSettings'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemPackagesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/packages'; 17 | $this->model_name = 'Package'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | $this->get_help_text = 'Reads all installed Packages.'; 21 | 22 | # Construct the parent Endpoint object 23 | parent::__construct(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNWireGuardPeerAllowedIPEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/wireguard/peer/allowed_ip'; 17 | $this->model_name = 'WireGuardPeerAllowedIP'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNWireGuardTunnelAddressEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/wireguard/tunnel/address'; 17 | $this->model_name = 'WireGuardTunnelAddress'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIResponsesValidationErrorTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 16 | response_id: 'TEST_ERROR', 17 | code: 400, 18 | callable: function () { 19 | throw new ValidationError(message: 'test error', response_id: 'TEST_ERROR'); 20 | }, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/DiagnosticsCommandPromptEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/diagnostics/command_prompt'; 16 | $this->model_name = 'CommandPrompt'; 17 | $this->request_method_options = ['POST']; 18 | $this->post_help_text = 'Executes a shell command.'; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallScheduleTimeRangeEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/schedule/time_range'; 17 | $this->model_name = 'FirewallScheduleTimeRange'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/RoutingStaticRoutesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/routing/static_routes'; 17 | $this->many = true; 18 | $this->model_name = 'StaticRoute'; 19 | $this->tag = 'ROUTING'; 20 | $this->request_method_options = ['GET', 'DELETE']; 21 | 22 | # Construct the parent Endpoint object 23 | parent::__construct(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDAccessListEntryEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/access_list/entry'; 17 | $this->model_name = 'BINDAccessListEntry'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesFreeRADIUSClientEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/freeradius/client'; 17 | $this->model_name = 'FreeRADIUSClient'; 18 | $this->many = false; 19 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemRESTAPIAccessListEntryEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/restapi/access_list/entry'; 17 | $this->model_name = 'RESTAPIAccessListEntry'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallNATOutboundMappingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/nat/outbound/mappings'; 16 | $this->model_name = 'OutboundNATMapping'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallTrafficShaperLimiterEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/traffic_shaper/limiter'; 17 | $this->model_name = 'TrafficShaperLimiter'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesACMECertificateActionEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/acme/certificate/action'; 17 | $this->model_name = 'ACMECertificateAction'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesACMECertificateDomainEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/acme/certificate/domain'; 17 | $this->model_name = 'ACMECertificateDomain'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesFreeRADIUSInterfacesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/freeradius/interfaces'; 17 | $this->model_name = 'FreeRADIUSInterface'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyBackendActionEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/backend/action'; 17 | $this->model_name = 'HAProxyBackendAction'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyBackendServerEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/backend/server'; 17 | $this->model_name = 'HAProxyBackendServer'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesWakeOnLANSendEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/wake_on_lan/send'; 17 | $this->model_name = 'WakeOnLANSend'; 18 | $this->request_method_options = ['POST']; 19 | $this->post_help_text = 'Sends a Wake-on-LAN magic packet.'; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIQueryFiltersGreaterThanQueryFilterTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_is_true($query_filter->evaluate(2, 1)); 15 | $this->assert_is_true($query_filter->evaluate('2', '1')); 16 | $this->assert_is_false($query_filter->evaluate(2, 2)); 17 | $this->assert_is_false($query_filter->evaluate(1, 2)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIResponsesNotAcceptableErrorTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 16 | response_id: 'TEST_ERROR', 17 | code: 406, 18 | callable: function () { 19 | throw new NotAcceptableError(message: 'test error', response_id: 'TEST_ERROR'); 20 | }, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Dispatchers/IPsecApplyDispatcher.inc: -------------------------------------------------------------------------------- 1 | = 0 and is_subsystem_dirty('ipsec')) { 22 | clear_subsystem_dirty('ipsec'); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallNATOneToOneMappingsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/nat/one_to_one/mappings'; 16 | $this->model_name = 'OneToOneNATMapping'; 17 | $this->many = true; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/RoutingGatewayGroupPriorityEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/routing/gateway/group/priority'; 17 | $this->model_name = 'RoutingGatewayGroupPriority'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDHCPServerAddressPoolEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dhcp_server/address_pool'; 17 | $this->model_name = 'DHCPServerAddressPool'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDNSResolverAccessListEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dns_resolver/access_list'; 17 | $this->model_name = 'DNSResolverAccessList'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyFrontendActionEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/frontend/action'; 17 | $this->model_name = 'HAProxyFrontendAction'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallTrafficShaperLimitersEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/traffic_shaper/limiters'; 17 | $this->model_name = 'TrafficShaperLimiter'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesBINDSyncRemoteHostsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/bind/sync/remote_hosts'; 17 | $this->model_name = 'BINDSyncRemoteHost'; 18 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 19 | $this->many = true; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDHCPServerCustomOptionEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dhcp_server/custom_option'; 17 | $this->model_name = 'DHCPServerCustomOption'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesFreeRADIUSInterfaceEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/freeradius/interface'; 17 | $this->model_name = 'FreeRADIUSInterface'; 18 | $this->many = false; 19 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyFrontendAddressEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/frontend/address'; 17 | $this->model_name = 'HAProxyFrontendAddress'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemCertificateAuthoritiesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/certificate_authorities'; 17 | $this->model_name = 'CertificateAuthority'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tools/templates/Makefile.j2: -------------------------------------------------------------------------------- 1 | # $FreeBSD$ 2 | 3 | PORTNAME=pfSense-pkg-RESTAPI 4 | PORTVERSION={{ files["port_version"] }} 5 | PORTREVISION={{ files["port_revision"] }} 6 | CATEGORIES=sysutils 7 | MASTER_SITES=# empty 8 | DISTFILES=# empty 9 | EXTRACT_ONLY=# empty 10 | MAINTAINER= github@jaredhendrickson.com 11 | COMMENT=pfSense REST API package 12 | LICENSE=APACHE20 13 | NO_BUILD=yes 14 | NO_MTREE=yes 15 | SUB_FILES=pkg-install pkg-deinstall 16 | SUB_LIST=PORTNAME=${PORTNAME} 17 | NO_ARCH=yes 18 | NOT_FOR_ARCHS=armv6 armv7 19 | 20 | do-extract: 21 | ${MKDIR} ${WRKSRC} 22 | 23 | do-install: 24 | {% for dir in files["dir"] -%} 25 | ${MKDIR} ${STAGEDIR}{{ dir }} 26 | {% endfor %} 27 | {% for file in files["file"] -%} 28 | ${INSTALL_DATA} ${FILESDIR}{{ file }} ${STAGEDIR}{{ file | dirname }} 29 | {% endfor %} 30 | .include 31 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIQueryFiltersLessThanEqualQueryFilterTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_is_true($query_filter->evaluate(1, 2)); 15 | $this->assert_is_true($query_filter->evaluate(2, 2)); 16 | $this->assert_is_true($query_filter->evaluate('2', '2')); 17 | $this->assert_is_false($query_filter->evaluate(3, 2)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDHCPServerBackendEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dhcp_server/backend'; 17 | $this->model_name = 'DHCPServerBackend'; 18 | $this->request_method_options = ['PATCH']; 19 | $this->patch_help_text = 'Select the DHCP Server Backend.'; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDHCPServerStaticMappingEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dhcp_server/static_mapping'; 17 | $this->model_name = 'DHCPServerStaticMapping'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDNSResolverHostOverrideEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dns_resolver/host_override'; 17 | $this->model_name = 'DNSResolverHostOverride'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesFreeRADIUSUsersEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/freeradius/users'; 19 | $this->model_name = 'FreeRADIUSUser'; 20 | $this->many = true; 21 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 22 | 23 | # Construct the parent Endpoint object 24 | parent::__construct(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyBackendErrorFileEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/backend/error_file'; 17 | $this->model_name = 'HAProxyBackendErrorFile'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxySettingsDNSResolverEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/settings/dns_resolver'; 17 | $this->model_name = 'HAProxyDNSResolver'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxySettingsEmailMailerEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/settings/email_mailer'; 17 | $this->model_name = 'HAProxyEmailMailer'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/DiagnosticsConfigHistoryRevisionsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/diagnostics/config_history/revisions'; 17 | $this->model_name = 'ConfigHistoryRevision'; 18 | $this->request_method_options = ['GET', 'DELETE']; 19 | $this->many = true; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDNSForwarderHostOverrideEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dns_forwarder/host_override'; 17 | $this->model_name = 'DNSForwarderHostOverride'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesFreeRADIUSUserEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/freeradius/user'; 19 | $this->model_name = 'FreeRADIUSUser'; 20 | $this->many = false; 21 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 22 | 23 | # Construct the parent Endpoint object 24 | parent::__construct(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesHAProxyFrontendErrorFileEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/frontend/error_file'; 17 | $this->model_name = 'HAProxyFrontendErrorFile'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesSSHEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/ssh'; 17 | $this->model_name = 'SSH'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | $this->get_help_text = 'Reads the current SSH server settings.'; 20 | $this->patch_help_text = 'Updates the current SSH server settings.'; 21 | 22 | # Construct the parent Endpoint object 23 | parent::__construct(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIResponsesAuthenticationErrorTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 17 | response_id: 'TEST_ERROR', 18 | code: 401, 19 | callable: function () { 20 | throw new AuthenticationError(message: 'test error', response_id: 'TEST_ERROR'); 21 | }, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallTrafficShaperLimiterQueueEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/traffic_shaper/limiter/queue'; 17 | $this->model_name = 'TrafficShaperLimiterQueue'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDNSResolverAccessListsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dns_resolver/access_lists'; 17 | $this->many = true; 18 | $this->model_name = 'DNSResolverAccessList'; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDNSResolverDomainOverrideEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dns_resolver/domain_override'; 17 | $this->model_name = 'DNSResolverDomainOverride'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemDNSEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/dns'; 17 | $this->model_name = 'SystemDNS'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | $this->get_help_text = 'Reads the current system DNS settings.'; 20 | $this->patch_help_text = 'Updates the current system DNS settings.'; 21 | 22 | # Construct the parent Endpoint object 23 | parent::__construct(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNIPsecApplyEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/ipsec/apply'; 16 | $this->model_name = 'IPsecApply'; 17 | $this->request_method_options = ['GET', 'POST']; 18 | $this->get_help_text = 'Read pending IPsec change status.'; 19 | $this->post_help_text = 'Apply pending IPsec changes.'; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNOpenVPNClientExportConfigEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/openvpn/client_export/config'; 17 | $this->model_name = 'OpenVPNClientExportConfig'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | $this->many = false; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/VPNOpenVPNClientExportConfigsEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/vpn/openvpn/client_export/configs'; 17 | $this->model_name = 'OpenVPNClientExportConfig'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIQueryFiltersGreaterThanEqualQueryFilterTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_is_true($query_filter->evaluate(2, 1)); 15 | $this->assert_is_true($query_filter->evaluate(2, 2)); 16 | $this->assert_is_true($query_filter->evaluate('2', '2')); 17 | $this->assert_is_false($query_filter->evaluate(1, 2)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIResponsesFailedDependencyErrorTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 16 | response_id: 'TEST_ERROR', 17 | code: 424, 18 | callable: function () { 19 | throw new FailedDependencyError(message: 'test error', response_id: 'TEST_ERROR'); 20 | }, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Dispatchers/FirewallStateTableResetDispatcher.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/haproxy/frontend/certificate'; 17 | $this->model_name = 'HAProxyFrontendCertificate'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/FirewallApplyEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/firewall/apply'; 16 | $this->model_name = 'FirewallApply'; 17 | $this->request_method_options = ['GET', 'POST']; 18 | $this->get_help_text = 'Read pending firewall change status.'; 19 | $this->post_help_text = 'Apply pending firewall changes.'; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDNSResolverHostOverridesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dns_resolver/host_overrides'; 17 | $this->model_name = 'DNSResolverHostOverride'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemCRLRevokedCertificateEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/crl/revoked_certificate'; 17 | $this->model_name = 'CertificateRevocationListRevokedCertificate'; 18 | $this->request_method_options = ['GET', 'POST', 'PATCH', 'DELETE']; 19 | 20 | # Construct the parent Endpoint object 21 | parent::__construct(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemCertificateRenewEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/certificate/renew'; 17 | $this->model_name = 'CertificateRenew'; 18 | $this->request_method_options = ['POST']; 19 | 20 | # Set help text 21 | $this->post_help_text = 'Renews an existing Certificate.'; 22 | 23 | # Construct the parent Endpoint object 24 | parent::__construct(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsAvailableInterfaceTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_is_true($available_interface->exists()); 16 | $this->assert_is_not_empty($available_interface->first()->if->value); 17 | $this->assert_is_not_empty($available_interface->first()->mac->value); 18 | $this->assert_is_not_empty($available_interface->first()->in_use_by->value); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIResponsesMethodNotAllowedErrorTestCase.inc: -------------------------------------------------------------------------------- 1 | assert_throws_response( 17 | response_id: 'TEST_ERROR', 18 | code: 405, 19 | callable: function () { 20 | throw new MethodNotAllowedError(message: 'test error', response_id: 'TEST_ERROR'); 21 | }, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/InterfaceApplyEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/interface/apply'; 17 | $this->model_name = 'InterfaceApply'; 18 | $this->request_method_options = ['GET', 'POST']; 19 | $this->get_help_text = 'Read pending interfaces status.'; 20 | $this->post_help_text = 'Apply pending interface changes.'; 21 | 22 | # Construct the parent Endpoint object 23 | parent::__construct(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesDNSForwarderHostOverridesEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/services/dns_forwarder/host_overrides'; 17 | $this->model_name = 'DNSForwarderHostOverride'; 18 | $this->many = true; 19 | $this->request_method_options = ['GET', 'PUT', 'DELETE']; 20 | 21 | # Construct the parent Endpoint object 22 | parent::__construct(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemHostnameEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/hostname'; 17 | $this->model_name = 'SystemHostname'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | $this->get_help_text = 'Reads the current system hostname.'; 20 | $this->patch_help_text = 'Updates the system hostname.'; 21 | 22 | # Construct the parent Endpoint object 23 | parent::__construct(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/SystemTimezoneEndpoint.inc: -------------------------------------------------------------------------------- 1 | url = '/api/v2/system/timezone'; 17 | $this->model_name = 'SystemTimezone'; 18 | $this->request_method_options = ['GET', 'PATCH']; 19 | $this->get_help_text = 'Reads the current system timezone.'; 20 | $this->patch_help_text = 'Updates the system timezone.'; 21 | 22 | # Construct the parent Endpoint object 23 | parent::__construct(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/.resources/scripts/dispatch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This is a helper script for \RESTAPI\Core\Dispatcher.inc. The Dispatcher class will spawn processes using this helper 4 | # script in the background. This script requires three arguments which are provided by the Dispatcher: 5 | # $1: The shortname of the Dispatcher class being called. 6 | # $2: The PID file associated with the spawned Dispatcher process. 7 | # $3: The number of seconds the Dispatcher process can run before timing out. 8 | # $4: Optional arguments to pass to the Dispatcher process in JSON format. 9 | 10 | # Start the Dispatcher process using manage.php (pfsense-restapi CLI), enforce timeout 11 | timeout --foreground $3 php -f /usr/local/pkg/RESTAPI/.resources/scripts/manage.php notifydispatcher $1 $4; 12 | 13 | # Remove the PID file associated with this Dispatcher process 14 | rm $2; 15 | --------------------------------------------------------------------------------