atsign-foundation / at_java

Java libraries, tools, samples and examples for the atPlatform
BSD 3-Clause "New" or "Revised" License
2 stars 19 forks source link

The Atsign FoundationThe Atsign Foundation

gitHub license OpenSSF Scorecard OpenSSF Best Practices

The atPlatform for Java developers

This repo contains libraries, tools, samples and examples for developers who wish to work with the atPlatform from Java code.

Maven Depdendency

The Java SDK can be added to your project through a compiled JAR or by Maven!

<repositories>
    <repository>
        <id>ossrh</id>
        <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>
<dependencies>
  <dependency>
      <groupId>io.github.atsign-foundation</groupId>
      <artifactId>at_client</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
</dependencies>

Getting Started

Note: Java and Maven are Prerequisites to use at_java

Clone the at_java repo from GItHub using

git clone https://github.com/atsign-foundation/at_java.git

Change directory into at_java/at_client

cd at_client

Compile the package using maven with the following command

mvn install

Now that the programs have been compiled, execute the following command to use at_java

java -cp "target/at_client-1.0-SNAPSHOT.jar:target/lib/*" org.atsign.client.cli.<class> [required arguments]

The different classes(functionalities) that at_java contains:

1) REPL 2) Share 3) Get 4) Delete 5) Register 6) Onboard

Note: Each of these classes requires a different set of arguments, make sure to read the help text and provide necessary arguments

Text about the remaining functionalities coming soon

Register

A class that accepts command line arguments which are used to fetch a free atsign and register it to the email provided. Further, this atsign can be activated using a verification code sent to the registered email.

Register with SUPER_API Key

Register can also be used with a SUPER_API Key that has privileges to preset and atsign with an activation code.

When using the SUPER_API Key to register an atsign, the following sequence of calls take place: 1) User provides at_java/Register with the SUPER_API Key passed as an argument 2) at_java calls the AtSign Registrar API Endpoint(get-atsign) with the SUPER_API Key provided 3) The AtSign registrar API responds with an AtSign-ActivationKey pair 4) at_java now call the AtSign Registrar API Endpoint(activate-atsign) with the AtSign-ActivationKey pair 5) The API responds with a json containing the CRAM_KEY for the concerned atsign 6) This CRAM_KEY can be used to activate the atsign further making it usable 7) at_java does the activation automatically for you and stores your atKeys* file at path '~/.atsign/keys' 8) Now the atsign is activated and the atKeys file can be used to authenticate and perform protected operation with/on the atSign.

Things to know about at_platform

1) Register: This is a class in at_java that has the functionality to call the necessary API, handle responses in order to fetch and register atsigns 2) AtSign Registrar API: An AtSign service that is responsible for handling atsign's server creation, registration, authentication, reset and deletion 3) SUPER_API Key:

Contributions welcome!

All of our software is open with intent. We welcome contributions - we want pull requests, and we want to hear about issues. See also CONTRIBUTING.md