@bigbinary/neeto-api-keys-frontend v2.3.6
neeto-api-keys-nano
The neeto-api-keys-nano facilitates the administration of API keys within
neeto applications. The nano exports the @bigbinary/neeto-api-keys-frontend
NPM package and neeto-api-keys-engine Rails engine for development.
Contents
Development with Host Application
Engine
The engine is used to manage API keys across neeto products. It also provides
concerns to handle common logic related to NeetoApiKeysEngine::ApiKey model.
Installation
Add this line to your application's Gemfile:
source "NEETO_GEM_SERVER_URL" do # ..existing gems gem 'neeto-api-keys-engine' endAnd then execute:
bundle install- Add this line to your application's
config/routes.rbfile:mount NeetoApiKeysEngine::Engine => "/neeto_api_keys_engine" - Run the command to bring in all migrations required from the engine to the
host application:
bundle exec rails neeto_api_keys_engine:install:migrations - Add the migrations to the database:
bundle exec rails db:migrate - Add the permission
neeto_api_keys_engine.manage_api_keysto yourpermissions.ymlfile.
Usage
Add
NeetoApiKeysEngine::ApiKeysHandlerconcern to organization model.class Organization < ActiveRecord::Base # Include the following concern include NeetoApiKeysEngine::ApiKeysHandlerThe
NeetoApiKeysEngine::ApiKeysHandlerconcern is a module that provides functionality related to API keys within the host application. It establishes associations, methods, and logic for working with API keys.Add the
NeetoApiKeysEngine::Authenticatableconcern to the controller that requires API key authentication. Utilize theneeto_api_keys_authenticate_using_api_keymethod within a before_action callback to authenticate the necessary actions.
class Api::V1::PublicApiController < ActionController::Base
# Include the following concern and callback
include NeetoApiKeysEngine::Authenticatable
before_action :neeto_api_keys_authenticate_using_api_keyBy default, this method expects the API key in the "X-Api-Key" key in the header. For different keys or implementations, define a token method in the controller that returns the token.
Example:
def token
request.headers["neeto-Api-Key"]
endFrontend package
Installation
Install the latest NeetoApiKeysNano package using the below command:
yarn add @bigbinary/neeto-api-keys-frontendInstructions for development
Check the Frontend package development guide for step-by-step instructions to develop the frontend package.
Components
ApiKeys(source code)
This component is used for managing API keys in a web application. It provides functionality for viewing, creating, updating, and deleting API keys. The component includes a table for displaying API key data, as well as options to add new keys, edit existing ones, and delete keys. It also features a search bar for easily finding specific API keys.
Props
noDataProps: Props for handling scenarios when there is no data to display.headerProps: Props for configuring the header section of the component.titleHelpPopoverProps: Props for configuring the help popover in the title section.zapierIntegrableType: If the host app has Zapier integration, the table will display Zapier keys only if the integrable type is "Organization." This prop is required if the integrable type is not "Organization" and is scoped to another entity.helpDocUrl: Prop for sending the permalink of the product's help article.
Usage
import React from "react";
import { ApiKeys } from "@bigbinary/neeto-api-keys-frontend";
const App = () => <ApiKeys />;
export default App;Instructions for Publishing
Consult the building and releasing packages guide for details on how to publish.
1 year ago
9 months ago
10 months ago
9 months ago
9 months ago
8 months ago
7 months ago
8 months ago
7 months ago
7 months ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago