{"id":22703962,"url":"https://github.com/hettiger/ngx-spa-honeypot","last_synced_at":"2025-03-29T20:11:54.492Z","repository":{"id":65144924,"uuid":"565407850","full_name":"hettiger/ngx-spa-honeypot","owner":"hettiger","description":"Angular Frontend Companion Library for hettiger/spa-honeypot","archived":false,"fork":false,"pushed_at":"2022-12-30T13:26:34.000Z","size":586,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T03:05:11.316Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hettiger.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-13T10:10:03.000Z","updated_at":"2022-12-30T13:27:35.000Z","dependencies_parsed_at":"2023-01-02T03:15:14.958Z","dependency_job_id":null,"html_url":"https://github.com/hettiger/ngx-spa-honeypot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hettiger%2Fngx-spa-honeypot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hettiger%2Fngx-spa-honeypot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hettiger%2Fngx-spa-honeypot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hettiger%2Fngx-spa-honeypot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hettiger","download_url":"https://codeload.github.com/hettiger/ngx-spa-honeypot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246237436,"owners_count":20745348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T08:13:22.123Z","updated_at":"2025-03-29T20:11:54.474Z","avatar_url":"https://github.com/hettiger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @hettiger/ngx-spa-honeypot\n\nAngular Frontend Companion Library for the Laravel PHP package [hettiger/spa-honeypot](https://github.com/hettiger/spa-honeypot).\n\n\u003e This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.2.3.\n\n## Development server (Demo Application)\n\nRun `ng serve demo` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.\n\n## Code scaffolding\n\nRun `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.\n\n## Build\n\nRun `npm run build` to build the project. The build artifacts will be stored in the `dist/` directory.\n\n\u003e Don't run `ng build` manually. There are additional pre- and post-build-steps involved.\n\n## Running unit tests\n\nRun `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).\n\n## Publish\n\nRun `npm run publish` to build and publish the project.\n\n## Further help\n\nTo get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.\n\n## Configuration\n\nWithout any customization on the backend configuration can be skipped entirely.\nHowever, a configuration may be required when customization takes place.\nApply your configuration as follows:\n\n```typescript\nimport { SPA_HONEYPOT_CONFIG, SpaHoneypotConfig } from 'ngx-spa-honeypot';\n\n@NgModule({\n  providers: [\n    {\n      provide: SPA_HONEYPOT_CONFIG,\n      useFactory: (): SpaHoneypotConfig =\u003e ({\n        domainTokenRoutePathMap: {\n          'api.domain.tld': 'token',\n        },\n      }),\n    },\n  ],\n  // …\n})\nexport class AppModule {}\n```\n\n\u003e See `SpaHoneypotConfig` for documentation on individual configuration values. \n\n## Honeypot Input Field\n\nThere are numerous ways to add a honeypot field which is actually a good thing.\nThis package does not try to provide a one size fits all solution because bots could easily optimize for that.\nInstead, you should simply add your honeypot fields exactly the same way that you would add any other form field.\nHowever, there are some things to consider:\n\n- Hide your honeypot field in a non-obvious way (e.g. repositioning via `first-child` CSS selector)\n- Add the `tabindex=\"-1\"` attribute so users don't navigate to the honeypot field using the `Tab` key\n- Add the `autocomplete=\"off\"` attribute when applicable so browsers don't fill out the honeypot field\n\n## Time Based Anti SPAM Protection\n\nTime based anti SPAM protection relies on a custom HTTP header that needs to be sent with each form request.\nThis package uses a directive and an HTTP interceptor to make this as convenient as possible.\nSimply add the `action` attribute to each form element that should be protected:\n\n```angular2html\n\u003cform\n  action=\"https://api.domain.tld/api/endpoint\" \n  novalidate\n  (ngSubmit)=\"onSubmit()\"\n\u003e\n    \u003c!-- Form Controls … --\u003e\n\u003c/form\u003e\n```\n\n\u003e Don't forget to protect the API endpoint using the `form` or `form.token` middleware.\n\u003e (Or using the `@requireFormToken` directive when you're calling a Lighthouse GraphQL API.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhettiger%2Fngx-spa-honeypot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhettiger%2Fngx-spa-honeypot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhettiger%2Fngx-spa-honeypot/lists"}