Beapi-io / spring-boot-starter-beapi

Springboot 'convention over config' starter for API Automation
Other
1 stars 1 forks source link
api api-governance automation convention-over-configuration rbac-authorization rest role-based-access-control springboot zero-trust-security

alt text

BeAPI Spring Boot Starter

Stable Version : 0.7.1

Development Version : 0.8.61-SNAPSHOT

Springboot Version : 2.6.2 (or greater)

Java Version (for implementation) : 17

Groovy Version (for implementation/spock test) : (v0.7.1) 2.5.4 / (v0.8.0) 4.0.8


License - Reciprocal Public License

Documentation - https://beapi-io.github.io/beapi-docs/

Demo Application - https://github.com/Beapi-io/beapi-java-demo

Configuration Files - https://github.com/orubel/spring-boot-starter-beapi-config (Note : Move these into your 'iostateDir' location as found in your demo-application/src/main/resources/beapi_api.yaml file)


BeAPI is an automated API backend.

It enables you to simply create the:


BeAPI stresses convention over config...

Most everything you need for API development should be provided & configured 'out of the box' BUT you have the ability to configure and override everything to your hearts content

BeAPI automates API Governance...

Tradional API application's bind all rules/data to controllers (ie handlers) making them impossible to be shared amongst distributed services. Through the creation and support of standardized services in our configuration docs, Beapi automates all processes: security (RBAC/ABAC, CORS, JWT), caching, synchronization across all servers, etc.

BeAPI simplifies configuration...

BeAPI abstracts these RULES/data as a 'config' file which is loaded at runtime and can be reloaded and SYNCHRONIZED with distributed services without requiring a restart.

BeAPI automates common usage...

By abstracting the rules, this allows for easier automation and allows for:


Functionality


Gradle Implementation

repositories {
    mavenLocal()
    mavenCentral()
    maven {
        url 'https://s01.oss.sonatype.org/content/repositories/releases'
    }
}

...

dependencies {
    ...
    implementation 'io.beapi:spring-boot-starter-beapi:0.6.5'
    ...
}

Getting a Token and calling your api -

Using the Java-demo implementation, this will get you your BEARER token to use in your calls/app:

curl -v -H "Content-Type: application/json" -X POST -d '{"username":"admin","password":"@6m!nP@s5"}' http://localhost:8080/authenticate

Then call your api normally:

curl -v -H "Content-Type: application/json" -H "Authorization: Bearer {your_token_here}" --request GET "http://localhost:8080/v{appVersion}/user/show/5"

Q&A

Flowchart

flowchart TD
    A[DispatcherServlet] --> B[RequestInitializationFilter]
    B --> |preHandler| C(ApiInterceptor)
    C --> D[ExchangeService] 
    C --> E[BatchExchangeService] 
    C --> F[ChainExchangeService] 
    D --> G[Controller extends BeapiRequestHandler]
    E --> G[Controller extends BeapiRequestHandler]
    F --> G[Controller extends BeapiRequestHandler]
    G --> |postHandler| C