jams-react-client: Added linting stage

Executes eslint and tsc on the client
Executes google-java-format on the server
Ticket: https://redmine.savoirfairelinux.com/issues/7361

Change-Id: I52c8a70661a4711fd037604ba541c3e7a0d6b3cf
This commit is contained in:
Philippe Larose
2024-03-27 11:53:26 -04:00
parent 31d599fa75
commit 9a2779989e
36 changed files with 510 additions and 656 deletions

46
Jenkinsfile vendored
View File

@ -31,6 +31,37 @@ node('jami-jamsbuildvm-01') {
sh '''git clone --depth=1 --branch=master https://${RING_GERRIT_URL}/jami-jams'''
}
stage('Lint') {
if (env.GERRIT_REFSPEC != null) {
dir(topDir) {
sh '''git fetch origin ${GERRIT_REFSPEC} && git checkout FETCH_HEAD
docker build -f extras/CI/Dockerfile.test -t jams-lint .
'''
parallel(
"lint-client": {
sh '''
docker run --rm jams-lint sh -c "cd jams-react-client && npm run lint:check"
'''
},
"tsc-compile-client": {
sh '''
docker run --rm jams-lint sh -c "cd jams-react-client && npm run compile"
'''
},
"lint-server": {
sh '''
docker run --rm jams-lint google-java-format -a --skip-reflowing-long-strings --set-exit-if-changed --glob=**/*.java
'''
},
failFast: true // Aborts the parallel steps if one of them fails
)
}
} else {
error "FAILED: I don't know what to test"
}
}
stage('Test') {
if (env.GERRIT_REFSPEC != null) {
dir(topDir) {
@ -40,19 +71,19 @@ node('jami-jamsbuildvm-01') {
"test-jdk-11": {
sh '''
docker build -f extras/CI/Dockerfile.test -t jams-test:11 --build-arg JAVA_VERSION=11 .
docker run jams-test:11 mvn verify
docker run --rm jams-test:11 mvn verify
'''
},
"test-jdk-17": {
sh '''
docker build -f extras/CI/Dockerfile.test -t jams-test:17 --build-arg JAVA_VERSION=17 .
docker run jams-test:17 mvn verify
docker run --rm jams-test:17 mvn verify
'''
},
"test-jdk-21": {
sh '''
docker build -f extras/CI/Dockerfile.test -t jams-test:21 --build-arg JAVA_VERSION=21 .
docker run jams-test:21 mvn verify
docker run --rm jams-test:21 mvn verify
'''
},
failFast: true // Aborts the parallel steps if one of them fails
@ -157,8 +188,17 @@ node('jami-jamsbuildvm-01') {
stage('Post') {
dir(topDir) {
// Archive the artifacts
archiveArtifacts artifacts: 'jams.tar', fingerprint: true
}
}
}
stage('Cleanup') {
dir(topDir) {
// Remove dangling docker images and containers
sh '''docker container prune -f && docker image prune -f'''
}
}
}

View File

@ -106,7 +106,7 @@ that can be installed with npm:
And is used with the following command:
`google-java-format -i -a --skip-reflowing-long-strings --skip-javadoc-formatting **/*.java `
`google-java-format -i -a --skip-reflowing-long-strings **/*.java`
## Generate documentation

View File

@ -45,7 +45,6 @@ import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SignatureException;
import java.security.cert.CertPath;
import java.security.cert.CertPathValidator;
import java.security.cert.CertificateFactory;

View File

@ -2,15 +2,18 @@ ARG JAVA_VERSION=11
FROM maven:3.9.6-eclipse-temurin-${JAVA_VERSION}
# Install Node.js v20.x
RUN apt-get update && \
apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
WORKDIR /test
COPY pom.xml .
COPY ad-connector/pom.xml ad-connector/pom.xml
COPY authentication-module/pom.xml authentication-module/pom.xml
COPY datastore/pom.xml datastore/pom.xml
COPY jami-dht/pom.xml jami-dht/pom.xml
COPY jami-nameserver/pom.xml jami-nameserver/pom.xml
COPY jams-ca/pom.xml jams-ca/pom.xml
COPY jams-common/pom.xml jams-common/pom.xml
COPY jams-launcher/pom.xml jams-launcher/pom.xml
COPY ldap-connector/pom.xml ldap-connector/pom.xml
COPY jams-server/pom.xml jams-server/pom.xml
COPY . .
# Install google-java-format tool
RUN npm install -g google-java-format
# Install client dependencies
RUN cd jams-react-client && npm install

View File

@ -5,4 +5,4 @@ cd jams-react-client
npm run format
cd ..
google-java-format -i -a --skip-reflowing-long-strings --skip-javadoc-formatting **/*.java
google-java-format -i -a --skip-reflowing-long-strings **/*.java

View File

@ -19,26 +19,20 @@
package net.jami.jams.dht.hashutils;
/**
* <p>This interface documents the API for a hash function. This
* interface somewhat mimics the standard {@code
* java.security.MessageDigest} class. We do not extend that class in
* order to provide compatibility with reduced Java implementations such
* as J2ME. Implementing a {@code java.security.Provider} compatible
* with Sun's JCA ought to be easy.</p>
* This interface documents the API for a hash function. This interface somewhat mimics the standard
* {@code java.security.MessageDigest} class. We do not extend that class in order to provide
* compatibility with reduced Java implementations such as J2ME. Implementing a {@code
* java.security.Provider} compatible with Sun's JCA ought to be easy.
*
* <p>A {@code Digest} object maintains a running state for a hash
* function computation. Data is inserted with {@code update()} calls;
* the result is obtained from a {@code digest()} method (where some
* final data can be inserted as well). When a digest output has been
* produced, the objet is automatically resetted, and can be used
* immediately for another digest operation. The state of a computation
* can be cloned with the {@link #copy} method; this can be used to get
* a partial hash result without interrupting the complete
* computation.</p>
* <p>A {@code Digest} object maintains a running state for a hash function computation. Data is
* inserted with {@code update()} calls; the result is obtained from a {@code digest()} method
* (where some final data can be inserted as well). When a digest output has been produced, the
* objet is automatically resetted, and can be used immediately for another digest operation. The
* state of a computation can be cloned with the {@link #copy} method; this can be used to get a
* partial hash result without interrupting the complete computation.
*
* <p>{@code Digest} objects are stateful and hence not thread-safe;
* however, distinct {@code Digest} objects can be accessed concurrently
* without any problem.</p>
* <p>{@code Digest} objects are stateful and hence not thread-safe; however, distinct {@code
* Digest} objects can be accessed concurrently without any problem.
*
* <pre>
* ==========================(LICENSE BEGIN)============================
@ -67,112 +61,103 @@ package net.jami.jams.dht.hashutils;
* ===========================(LICENSE END)=============================
* </pre>
*
* @version $Revision: 232 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
* @version $Revision: 232 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
*/
public interface Digest {
/**
* Insert one more input data byte.
*
* @param in the input byte
* @param in the input byte
*/
void update(byte in);
/**
* Insert some more bytes.
*
* @param inbuf the data bytes
* @param inbuf the data bytes
*/
void update(byte[] inbuf);
/**
* Insert some more bytes.
*
* @param inbuf the data buffer
* @param off the data offset in {@code inbuf}
* @param len the data length (in bytes)
* @param inbuf the data buffer
* @param off the data offset in {@code inbuf}
* @param len the data length (in bytes)
*/
void update(byte[] inbuf, int off, int len);
/**
* Finalize the current hash computation and return the hash value
* in a newly-allocated array. The object is resetted.
* Finalize the current hash computation and return the hash value in a newly-allocated array.
* The object is resetted.
*
* @return the hash output
* @return the hash output
*/
byte[] digest();
/**
* Input some bytes, then finalize the current hash computation
* and return the hash value in a newly-allocated array. The object
* is resetted.
* Input some bytes, then finalize the current hash computation and return the hash value in a
* newly-allocated array. The object is resetted.
*
* @param inbuf the input data
* @return the hash output
* @param inbuf the input data
* @return the hash output
*/
byte[] digest(byte[] inbuf);
/**
* Finalize the current hash computation and store the hash value
* in the provided output buffer. The {@code len} parameter
* contains the maximum number of bytes that should be written;
* no more bytes than the natural hash function output length will
* be produced. If {@code len} is smaller than the natural
* hash output length, the hash output is truncated to its first
* {@code len} bytes. The object is resetted.
* Finalize the current hash computation and store the hash value in the provided output buffer.
* The {@code len} parameter contains the maximum number of bytes that should be written; no
* more bytes than the natural hash function output length will be produced. If {@code len} is
* smaller than the natural hash output length, the hash output is truncated to its first {@code
* len} bytes. The object is resetted.
*
* @param outbuf the output buffer
* @param off the output offset within {@code outbuf}
* @param len the requested hash output length (in bytes)
* @return the number of bytes actually written in {@code outbuf}
* @param outbuf the output buffer
* @param off the output offset within {@code outbuf}
* @param len the requested hash output length (in bytes)
* @return the number of bytes actually written in {@code outbuf}
*/
int digest(byte[] outbuf, int off, int len);
/**
* Get the natural hash function output length (in bytes).
*
* @return the digest output length (in bytes)
* @return the digest output length (in bytes)
*/
int getDigestLength();
/**
* Reset the object: this makes it suitable for a new hash
* computation. The current computation, if any, is discarded.
* Reset the object: this makes it suitable for a new hash computation. The current computation,
* if any, is discarded.
*/
void reset();
/**
* Clone the current state. The returned object evolves independantly
* of this object.
* Clone the current state. The returned object evolves independantly of this object.
*
* @return the clone
* @return the clone
*/
Digest copy();
/**
* <p>Return the "block length" for the hash function. This
* value is naturally defined for iterated hash functions
* (Merkle-Damgard). It is used in HMAC (that's what the
* <a href="http://tools.ietf.org/html/rfc2104">HMAC specification</a>
* names the "{@code B}" parameter).</p>
* Return the "block length" for the hash function. This value is naturally defined for iterated
* hash functions (Merkle-Damgard). It is used in HMAC (that's what the <a
* href="http://tools.ietf.org/html/rfc2104">HMAC specification</a> names the "{@code B}"
* parameter).
*
* <p>If the function is "block-less" then this function may
* return {@code -n} where {@code n} is an integer such that the
* block length for HMAC ("{@code B}") will be inferred from the
* key length, by selecting the smallest multiple of {@code n}
* which is no smaller than the key length. For instance, for
* the Fugue-xxx hash functions, this function returns -4: the
* virtual block length B is the HMAC key length, rounded up to
* the next multiple of 4.</p>
* <p>If the function is "block-less" then this function may return {@code -n} where {@code n}
* is an integer such that the block length for HMAC ("{@code B}") will be inferred from the key
* length, by selecting the smallest multiple of {@code n} which is no smaller than the key
* length. For instance, for the Fugue-xxx hash functions, this function returns -4: the virtual
* block length B is the HMAC key length, rounded up to the next multiple of 4.
*
* @return the internal block length (in bytes), or {@code -n}
* @return the internal block length (in bytes), or {@code -n}
*/
int getBlockLength();
/**
* <p>Get the display name for this function (e.g. {@code "SHA-1"}
* for SHA-1).</p>
* Get the display name for this function (e.g. {@code "SHA-1"} for SHA-1).
*
* @see Object
*/

View File

@ -19,18 +19,15 @@
package net.jami.jams.dht.hashutils;
/**
* <p>This class is a template which can be used to implement hash
* functions. It takes care of some of the API, and also provides an
* internal data buffer whose length is equal to the hash function
* internal block length.</p>
* This class is a template which can be used to implement hash functions. It takes care of some of
* the API, and also provides an internal data buffer whose length is equal to the hash function
* internal block length.
*
* <p>Classes which use this template MUST provide a working {@link
* #getBlockLength} method even before initialization (alternatively,
* they may define a custom {@link #getInternalBlockLength} which does
* not call {@link #getBlockLength}. The {@link #getDigestLength} should
* also be operational from the beginning, but it is acceptable that it
* returns 0 while the {@link #doInit} method has not been called
* yet.</p>
* <p>Classes which use this template MUST provide a working {@link #getBlockLength} method even
* before initialization (alternatively, they may define a custom {@link #getInternalBlockLength}
* which does not call {@link #getBlockLength}. The {@link #getDigestLength} should also be
* operational from the beginning, but it is acceptable that it returns 0 while the {@link #doInit}
* method has not been called yet.
*
* <pre>
* ==========================(LICENSE BEGIN)============================
@ -59,40 +56,35 @@ package net.jami.jams.dht.hashutils;
* ===========================(LICENSE END)=============================
* </pre>
*
* @version $Revision: 229 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
* @version $Revision: 229 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
*/
public abstract class DigestEngine implements Digest {
/**
* Reset the hash algorithm state.
*/
/** Reset the hash algorithm state. */
protected abstract void engineReset();
/**
* Process one block of data.
*
* @param data the data block
* @param data the data block
*/
protected abstract void processBlock(byte[] data);
/**
* Perform the final padding and store the result in the
* provided buffer. This method shall call {@link #flush}
* and then {@link #update} with the appropriate padding
* data in order to get the full input data.
* Perform the final padding and store the result in the provided buffer. This method shall call
* {@link #flush} and then {@link #update} with the appropriate padding data in order to get the
* full input data.
*
* @param buf the output buffer
* @param off the output offset
* @param buf the output buffer
* @param off the output offset
*/
protected abstract void doPadding(byte[] buf, int off);
/**
* This function is called at object creation time; the
* implementation should use it to perform initialization tasks.
* After this method is called, the implementation should be ready
* to process data or meaningfully honour calls such as
* {@link #getDigestLength}</code>.
* This function is called at object creation time; the implementation should use it to perform
* initialization tasks. After this method is called, the implementation should be ready to
* process data or meaningfully honour calls such as {@link #getDigestLength}</code>.
*/
protected abstract void doInit();
@ -103,9 +95,7 @@ public abstract class DigestEngine implements Digest {
private byte[] outputBuf;
private long blockCount;
/**
* Instantiate the engine.
*/
/** Instantiate the engine. */
public DigestEngine() {
doInit();
digestLen = getDigestLength();
@ -123,7 +113,9 @@ public abstract class DigestEngine implements Digest {
}
}
/** @see Digest */
/**
* @see Digest
*/
public byte[] digest() {
adjustDigestLen();
byte[] result = new byte[digestLen];
@ -131,13 +123,17 @@ public abstract class DigestEngine implements Digest {
return result;
}
/** @see Digest */
/**
* @see Digest
*/
public byte[] digest(byte[] input) {
update(input, 0, input.length);
return digest();
}
/** @see Digest */
/**
* @see Digest
*/
public int digest(byte[] buf, int offset, int len) {
adjustDigestLen();
if (len >= digestLen) {
@ -152,14 +148,18 @@ public abstract class DigestEngine implements Digest {
}
}
/** @see Digest */
/**
* @see Digest
*/
public void reset() {
engineReset();
inputLen = 0;
blockCount = 0;
}
/** @see Digest */
/**
* @see Digest
*/
public void update(byte input) {
inputBuf[inputLen++] = input;
if (inputLen == blockLen) {
@ -169,12 +169,16 @@ public abstract class DigestEngine implements Digest {
}
}
/** @see Digest */
/**
* @see Digest
*/
public void update(byte[] input) {
update(input, 0, input.length);
}
/** @see Digest */
/**
* @see Digest
*/
public void update(byte[] input, int offset, int len) {
while (len > 0) {
int copyLen = blockLen - inputLen;
@ -192,67 +196,58 @@ public abstract class DigestEngine implements Digest {
}
/**
* Get the internal block length. This is the length (in
* bytes) of the array which will be passed as parameter to
* {@link #processBlock}. The default implementation of this
* method calls {@link #getBlockLength} and returns the same
* value. Overriding this method is useful when the advertised
* block length (which is used, for instance, by HMAC) is
* suboptimal with regards to internal buffering needs.
* Get the internal block length. This is the length (in bytes) of the array which will be
* passed as parameter to {@link #processBlock}. The default implementation of this method calls
* {@link #getBlockLength} and returns the same value. Overriding this method is useful when the
* advertised block length (which is used, for instance, by HMAC) is suboptimal with regards to
* internal buffering needs.
*
* @return the internal block length (in bytes)
* @return the internal block length (in bytes)
*/
protected int getInternalBlockLength() {
return getBlockLength();
}
/**
* Flush internal buffers, so that less than a block of data
* may at most be upheld.
* Flush internal buffers, so that less than a block of data may at most be upheld.
*
* @return the number of bytes still unprocessed after the flush
* @return the number of bytes still unprocessed after the flush
*/
protected final int flush() {
return inputLen;
}
/**
* Get a reference to an internal buffer with the same size
* than a block. The contents of that buffer are defined only
* immediately after a call to {@link #flush()}: if
* {@link #flush()} return the value {@code n}, then the
* first {@code n} bytes of the array returned by this method
* are the {@code n} bytes of input data which are still
* unprocessed. The values of the remaining bytes are
* undefined and may be altered at will.
* Get a reference to an internal buffer with the same size than a block. The contents of that
* buffer are defined only immediately after a call to {@link #flush()}: if {@link #flush()}
* return the value {@code n}, then the first {@code n} bytes of the array returned by this
* method are the {@code n} bytes of input data which are still unprocessed. The values of the
* remaining bytes are undefined and may be altered at will.
*
* @return a block-sized internal buffer
* @return a block-sized internal buffer
*/
protected final byte[] getBlockBuffer() {
return inputBuf;
}
/**
* Get the "block count": this is the number of times the
* {@link #processBlock} method has been invoked for the
* current hash operation. That counter is incremented
* <em>after</em> the call to {@link #processBlock}.
* Get the "block count": this is the number of times the {@link #processBlock} method has been
* invoked for the current hash operation. That counter is incremented <em>after</em> the call
* to {@link #processBlock}.
*
* @return the block count
* @return the block count
*/
protected long getBlockCount() {
return blockCount;
}
/**
* This function copies the internal buffering state to some
* other instance of a class extending {@code DigestEngine}.
* It returns a reference to the copy. This method is intended
* to be called by the implementation of the {@link #copy}
* method.
* This function copies the internal buffering state to some other instance of a class extending
* {@code DigestEngine}. It returns a reference to the copy. This method is intended to be
* called by the implementation of the {@link #copy} method.
*
* @param dest the copy
* @return the value {@code dest}
* @param dest the copy
* @return the value {@code dest}
*/
protected Digest copyState(DigestEngine dest) {
dest.inputLen = inputLen;

View File

@ -36,10 +36,9 @@ package net.jami.jams.dht.hashutils;
/**
* format validation
*
* This class encodes/decodes hexadecimal data
* <p>This class encodes/decodes hexadecimal data
*
* @xerces.internal
*
* @author Jeffrey Rodriguez
* @version $Id: HexBin.java 446747 2006-09-15 21:46:20Z mrglavas $
*/

View File

@ -18,8 +18,7 @@ package net.jami.jams.dht.hashutils;
// $Id: Keccak256.java 189 2010-05-14 21:21:46Z tp $
/**
* <p>This class implements the Keccak-256 digest algorithm under the
* {@link Digest} API.</p>
* This class implements the Keccak-256 digest algorithm under the {@link Digest} API.
*
* <pre>
* ==========================(LICENSE BEGIN)============================
@ -48,22 +47,24 @@ package net.jami.jams.dht.hashutils;
* ===========================(LICENSE END)=============================
* </pre>
*
* @version $Revision: 189 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
* @version $Revision: 189 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
*/
public class Keccak256 extends KeccakCore {
/**
* Create the engine.
*/
/** Create the engine. */
public Keccak256() {}
/** @see Digest */
/**
* @see Digest
*/
public Digest copy() {
return copyState(new Keccak256());
}
/** @see Digest */
/**
* @see Digest
*/
public int getDigestLength() {
return 32;
}

View File

@ -19,8 +19,7 @@
package net.jami.jams.dht.hashutils;
/**
* This class implements the core operations for the Keccak digest
* algorithm.
* This class implements the core operations for the Keccak digest algorithm.
*
* <pre>
* ==========================(LICENSE BEGIN)============================
@ -49,8 +48,8 @@ package net.jami.jams.dht.hashutils;
* ===========================(LICENSE END)=============================
* </pre>
*
* @version $Revision: 258 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
* @version $Revision: 258 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
*/
abstract class KeccakCore extends DigestEngine {
@ -75,13 +74,12 @@ abstract class KeccakCore extends DigestEngine {
};
/**
* Encode the 64-bit word {@code val} into the array
* {@code buf} at offset {@code off}, in little-endian
* convention (least significant byte first).
* Encode the 64-bit word {@code val} into the array {@code buf} at offset {@code off}, in
* little-endian convention (least significant byte first).
*
* @param val the value to encode
* @param buf the destination buffer
* @param off the destination offset
* @param val the value to encode
* @param buf the destination buffer
* @param off the destination offset
*/
private static final void encodeLELong(long val, byte[] buf, int off) {
buf[off] = (byte) val;
@ -95,12 +93,11 @@ abstract class KeccakCore extends DigestEngine {
}
/**
* Decode a 64-bit little-endian word from the array {@code buf}
* at offset {@code off}.
* Decode a 64-bit little-endian word from the array {@code buf} at offset {@code off}.
*
* @param buf the source buffer
* @param off the source offset
* @return the decoded value
* @param buf the source buffer
* @param off the source offset
* @return the decoded value
*/
private static final long decodeLELong(byte[] buf, int off) {
return (buf[off] & 0xFFL)
@ -113,12 +110,16 @@ abstract class KeccakCore extends DigestEngine {
| ((buf[off + 7] & 0xFFL) << 56);
}
/** @see DigestEngine */
/**
* @see DigestEngine
*/
protected void engineReset() {
doReset();
}
/** @see DigestEngine */
/**
* @see DigestEngine
*/
protected void processBlock(byte[] data) {
/* Input block */
for (int i = 0; i < data.length; i += 8) A[i >>> 3] ^= decodeLELong(data, i);
@ -526,7 +527,9 @@ abstract class KeccakCore extends DigestEngine {
}
}
/** @see DigestEngine */
/**
* @see DigestEngine
*/
protected void doPadding(byte[] out, int off) {
int ptr = flush();
byte[] buf = getBlockBuffer();
@ -549,14 +552,18 @@ abstract class KeccakCore extends DigestEngine {
System.arraycopy(tmpOut, 0, out, off, dlen);
}
/** @see DigestEngine */
/**
* @see DigestEngine
*/
protected void doInit() {
A = new long[25];
tmpOut = new byte[(getDigestLength() + 7) & ~7];
doReset();
}
/** @see Digest */
/**
* @see Digest
*/
public int getBlockLength() {
return 200 - 2 * getDigestLength();
}
@ -571,13 +578,17 @@ abstract class KeccakCore extends DigestEngine {
A[20] = 0xFFFFFFFFFFFFFFFFL;
}
/** @see DigestEngine */
/**
* @see DigestEngine
*/
protected Digest copyState(KeccakCore dst) {
System.arraycopy(A, 0, dst.A, 0, 25);
return super.copyState(dst);
}
/** @see Digest */
/**
* @see Digest
*/
public String toString() {
return "Keccak-" + (getDigestLength() << 3);
}

View File

@ -19,9 +19,9 @@
package net.jami.jams.dht.hashutils;
/**
* <p>This class implements the padding common to MD4, MD5, the SHA family,
* and RIPEMD-160. This code works as long as the internal block length
* is a power of 2, which is the case for all these algorithms.</p>
* This class implements the padding common to MD4, MD5, the SHA family, and RIPEMD-160. This code
* works as long as the internal block length is a power of 2, which is the case for all these
* algorithms.
*
* <pre>
* ==========================(LICENSE BEGIN)============================
@ -50,41 +50,35 @@ package net.jami.jams.dht.hashutils;
* ===========================(LICENSE END)=============================
* </pre>
*
* @version $Revision: 157 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
* @version $Revision: 157 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
*/
abstract class MDHelper extends DigestEngine {
/**
* Create the object. Little-endian padding is for MD4, MD5 and
* RIPEMD-160; the SHA family uses big-endian padding. The
* MD padding includes an encoding of the input message bit length,
* which is over 64 bits for some algorithms, 128-bit for others
* (namely SHA-384 and SHA-512). Note that this implementation
* handles only message lengths which fit on 64 bits.
* Create the object. Little-endian padding is for MD4, MD5 and RIPEMD-160; the SHA family uses
* big-endian padding. The MD padding includes an encoding of the input message bit length,
* which is over 64 bits for some algorithms, 128-bit for others (namely SHA-384 and SHA-512).
* Note that this implementation handles only message lengths which fit on 64 bits.
*
* @param littleEndian {@code true} for little-endian padding
* @param lenlen the length encoding length, in bytes (must
* be at least 8)
* @param littleEndian {@code true} for little-endian padding
* @param lenlen the length encoding length, in bytes (must be at least 8)
*/
MDHelper(boolean littleEndian, int lenlen) {
this(littleEndian, lenlen, (byte) 0x80);
}
/**
* Create the object. Little-endian padding is for MD4, MD5 and
* RIPEMD-160; the SHA family uses big-endian padding. The
* MD padding includes an encoding of the input message bit length,
* which is over 64 bits for some algorithms, 128-bit for others
* (namely SHA-384 and SHA-512). Note that this implementation
* handles only message lengths which fit on 64 bits. The first
* additional byte value is specified; this is normally 0x80,
* except for Tiger (not Tiger2) which uses 0x01.
* Create the object. Little-endian padding is for MD4, MD5 and RIPEMD-160; the SHA family uses
* big-endian padding. The MD padding includes an encoding of the input message bit length,
* which is over 64 bits for some algorithms, 128-bit for others (namely SHA-384 and SHA-512).
* Note that this implementation handles only message lengths which fit on 64 bits. The first
* additional byte value is specified; this is normally 0x80, except for Tiger (not Tiger2)
* which uses 0x01.
*
* @param littleEndian {@code true} for little-endian padding
* @param lenlen the length encoding length, in bytes (must
* be at least 8)
* @param fbyte the first padding byte
* @param littleEndian {@code true} for little-endian padding
* @param lenlen the length encoding length, in bytes (must be at least 8)
* @param fbyte the first padding byte
*/
MDHelper(boolean littleEndian, int lenlen, byte fbyte) {
this.littleEndian = littleEndian;
@ -96,10 +90,7 @@ abstract class MDHelper extends DigestEngine {
private final byte[] countBuf;
private final byte fbyte;
/**
* Compute the padding. The padding data is input into the engine,
* which is flushed.
*/
/** Compute the padding. The padding data is input into the engine, which is flushed. */
protected void makeMDPadding() {
int dataLen = flush();
int blen = getBlockLength();
@ -128,13 +119,12 @@ abstract class MDHelper extends DigestEngine {
}
/**
* Encode the 32-bit word {@code val} into the array
* {@code buf} at offset {@code off}, in little-endian
* convention (least significant byte first).
* Encode the 32-bit word {@code val} into the array {@code buf} at offset {@code off}, in
* little-endian convention (least significant byte first).
*
* @param val the value to encode
* @param buf the destination buffer
* @param off the destination offset
* @param val the value to encode
* @param buf the destination buffer
* @param off the destination offset
*/
private static final void encodeLEInt(int val, byte[] buf, int off) {
buf[off] = (byte) val;
@ -144,13 +134,12 @@ abstract class MDHelper extends DigestEngine {
}
/**
* Encode the 32-bit word {@code val} into the array
* {@code buf} at offset {@code off}, in big-endian
* convention (most significant byte first).
* Encode the 32-bit word {@code val} into the array {@code buf} at offset {@code off}, in
* big-endian convention (most significant byte first).
*
* @param val the value to encode
* @param buf the destination buffer
* @param off the destination offset
* @param val the value to encode
* @param buf the destination buffer
* @param off the destination offset
*/
private static final void encodeBEInt(int val, byte[] buf, int off) {
buf[off] = (byte) (val >>> 24);

View File

@ -19,8 +19,7 @@
package net.jami.jams.dht.hashutils;
/**
* This class implements SHA-224 and SHA-256, which differ only by the IV
* and the output length.
* This class implements SHA-224 and SHA-256, which differ only by the IV and the output length.
*
* <pre>
* ==========================(LICENSE BEGIN)============================
@ -49,14 +48,12 @@ package net.jami.jams.dht.hashutils;
* ===========================(LICENSE END)=============================
* </pre>
*
* @version $Revision: 214 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
* @version $Revision: 214 $
* @author Thomas Pornin &lt;thomas.pornin@cryptolog.com&gt;
*/
abstract class SHA2Core extends MDHelper {
/**
* Create the object.
*/
/** Create the object. */
SHA2Core() {
super(false, 8);
}
@ -83,18 +80,24 @@ abstract class SHA2Core extends MDHelper {
private int[] currentVal, W;
/** @see DigestEngine */
/**
* @see DigestEngine
*/
protected Digest copyState(SHA2Core dst) {
System.arraycopy(currentVal, 0, dst.currentVal, 0, currentVal.length);
return super.copyState(dst);
}
/** @see Digest */
/**
* @see Digest
*/
public int getBlockLength() {
return 64;
}
/** @see DigestEngine */
/**
* @see DigestEngine
*/
protected void engineReset() {
System.arraycopy(getInitVal(), 0, currentVal, 0, 8);
}
@ -102,11 +105,13 @@ abstract class SHA2Core extends MDHelper {
/**
* Get the initial value for this algorithm.
*
* @return the initial value (eight 32-bit words)
* @return the initial value (eight 32-bit words)
*/
abstract int[] getInitVal();
/** @see DigestEngine */
/**
* @see DigestEngine
*/
protected void doPadding(byte[] output, int outputOffset) {
makeMDPadding();
int olen = getDigestLength();
@ -114,7 +119,9 @@ abstract class SHA2Core extends MDHelper {
encodeBEInt(currentVal[i], output, outputOffset + j);
}
/** @see DigestEngine */
/**
* @see DigestEngine
*/
protected void doInit() {
currentVal = new int[8];
W = new int[64];
@ -122,13 +129,12 @@ abstract class SHA2Core extends MDHelper {
}
/**
* Encode the 32-bit word {@code val} into the array
* {@code buf} at offset {@code off}, in big-endian
* convention (most significant byte first).
* Encode the 32-bit word {@code val} into the array {@code buf} at offset {@code off}, in
* big-endian convention (most significant byte first).
*
* @param val the value to encode
* @param buf the destination buffer
* @param off the destination offset
* @param val the value to encode
* @param buf the destination buffer
* @param off the destination offset
*/
private static final void encodeBEInt(int val, byte[] buf, int off) {
buf[off] = (byte) (val >>> 24);
@ -138,12 +144,11 @@ abstract class SHA2Core extends MDHelper {
}
/**
* Decode a 32-bit big-endian word from the array {@code buf}
* at offset {@code off}.
* Decode a 32-bit big-endian word from the array {@code buf} at offset {@code off}.
*
* @param buf the source buffer
* @param off the source offset
* @return the decoded value
* @param buf the source buffer
* @param off the source offset
* @return the decoded value
*/
private static final int decodeBEInt(byte[] buf, int off) {
return ((buf[off] & 0xFF) << 24)
@ -153,19 +158,20 @@ abstract class SHA2Core extends MDHelper {
}
/**
* Perform a circular rotation by {@code n} to the left
* of the 32-bit word {@code x}. The {@code n} parameter
* must lie between 1 and 31 (inclusive).
* Perform a circular rotation by {@code n} to the left of the 32-bit word {@code x}. The {@code
* n} parameter must lie between 1 and 31 (inclusive).
*
* @param x the value to rotate
* @param n the rotation count (between 1 and 31)
* @return the rotated value
* @param x the value to rotate
* @param n the rotation count (between 1 and 31)
* @return the rotated value
*/
private static int circularLeft(int x, int n) {
return (x << n) | (x >>> (32 - n));
}
/** @see DigestEngine */
/**
* @see DigestEngine
*/
protected void processBlock(byte[] data) {
int A = currentVal[0];
int B = currentVal[1];
@ -634,7 +640,9 @@ abstract class SHA2Core extends MDHelper {
*/
}
/** @see Digest */
/**
* @see Digest
*/
public String toString() {
return "SHA-" + (getDigestLength() << 3);
}

View File

@ -18,14 +18,14 @@ package net.jami.jams.common.cryptoengineapi.ocsp;
public enum CertificateStatus {
VALID,
/** The certificate is valid **/
/** The certificate is valid * */
REVOKED,
/** The certificate has been revoked **/
/** The certificate has been revoked * */
EXPIRED,
/** The certificate is expired **/
/** The certificate is expired * */
UNKNOWN;
/** The certificate is unknown **/
/** The certificate is unknown * */
public static CertificateStatus fromString(String status) {
switch (status) {
case "V":

View File

@ -28,104 +28,91 @@ public enum RevocationReason {
/**
* Code = 0, Name = unspecified
* <p>
* Can be used to revoke certificates for reasons other than the specific codes.
* </p>
*
* <p>Can be used to revoke certificates for reasons other than the specific codes.
*/
UNSPECIFIED(0, "unspecified"),
/**
* Code = 1, Name = keyCompromise
* <p>
* Used in revoking an end-entity certificate. It indicates that it is known or
* suspected that the subject's private key, or other aspects of the subject
* validated in the certificate, have been compromised.
* </p>
*
* <p>Used in revoking an end-entity certificate. It indicates that it is known or suspected
* that the subject's private key, or other aspects of the subject validated in the certificate,
* have been compromised.
*/
KEY_COMPROMISE(1, "keyCompromise"),
/**
* Code = 2, Name = CACompromise
* <p>
* Used in revoking a CA-certificate. It indicates that it is known or suspected
* that the subject's private key, or other aspects of the subject validated in
* the certificate, have been compromised.
* </p>
*
* <p>Used in revoking a CA-certificate. It indicates that it is known or suspected that the
* subject's private key, or other aspects of the subject validated in the certificate, have
* been compromised.
*/
CA_COMPROMISE(2, "CACompromise"),
/**
* Code = 3, Name = affiliationChanged
* <p>
* Indicates that the subject's name or other information in the certificate has
* been modified but there is no cause to suspect that the private key has been
* compromised.
* </p>
*
* <p>Indicates that the subject's name or other information in the certificate has been
* modified but there is no cause to suspect that the private key has been compromised.
*/
AFFILIATION_CHANGED(3, "affiliationChanged"),
/**
* Code = 4, Name = superseded
* <p>
* Indicates that the certificate has been superseded but there is no cause to
* suspect that the private key has been compromised.
* </p>
*
* <p>Indicates that the certificate has been superseded but there is no cause to suspect that
* the private key has been compromised.
*/
SUPERSEDED(4, "superseded"),
/**
* Code = 5, Name = cessationOfOperation
* <p>
* Indicates that the certificate is no longer needed for the purpose for which
* it was issued but there is no cause to suspect that the private key has been
* compromised.
* </p>
*
* <p>Indicates that the certificate is no longer needed for the purpose for which it was issued
* but there is no cause to suspect that the private key has been compromised.
*/
CESSATION_OF_OPERATION(5, "cessationOfOperation"),
/**
* Code = 6, Name = certificateHold
* <p>
* Indicates that the certificate is temporarily revoked but there is no cause
* to suspect that the private kye has been compromised; the certificate can
* later be revoked with another reason code, or unrevoked and returned to use.
*
* <p>Indicates that the certificate is temporarily revoked but there is no cause to suspect
* that the private kye has been compromised; the certificate can later be revoked with another
* reason code, or unrevoked and returned to use.
*/
CERTIFICATE_HOLD(6, "certificateHold"),
/**
* Code = 7, Name = unused
* <p>
* This code is obsolete and unused.
* </p>
*
* <p>This code is obsolete and unused.
*/
UNUSED(7, "unused"),
/**
* Code = 8, Name = removeFromCRL
* <p>
* Indicates that the certificate has been unrevoked. NOTE: This is specific to
* the CertificateHold reason and is only used in DeltaCRLs.
* </p>
*
* <p>Indicates that the certificate has been unrevoked. NOTE: This is specific to the
* CertificateHold reason and is only used in DeltaCRLs.
*/
REMOVE_FROM_CRL(8, "removeFromCRL"),
/**
* Code = 9, Name = privilegeWithdrawn
* <p>
* Indicates that a certificate (public-key or attribute certificate) was
* revoked because a privilege contained within that certificate has been
* withdrawn. Unused in OpenSSL.
* </p>
*
* <p>Indicates that a certificate (public-key or attribute certificate) was revoked because a
* privilege contained within that certificate has been withdrawn. Unused in OpenSSL.
*/
PRIVILEGE_WITHDRAWN(9, "privilegeWithdrawn"),
/**
* Code = 10, Name = AACompromise
* <p>
* Indicates that it is known or suspected that aspects of the AA validated in
* the attribute certificate, have been compromised. It applies to authority
* attribute (AA) certificates only. Unused in OpenSSL.
* </p>
*
* <p>Indicates that it is known or suspected that aspects of the AA validated in the attribute
* certificate, have been compromised. It applies to authority attribute (AA) certificates only.
* Unused in OpenSSL.
*/
AA_COMPROMISE(10, "AACompromise");

View File

@ -25,13 +25,8 @@ import java.lang.reflect.Type;
public class ContactAdapter implements JsonSerializer<Contact>, JsonDeserializer<Contact> {
/**
* {
* "added" : 1595523510,
* "banned" : false,
* "uri" : "520290d7f45e5811fe5af637d328e7fbf5e8cab9",
* "removed" : 0,
* "conversationId": "6a61013979964f70c8fb9183a8b238d58a1846ed"
* }
* { "added" : 1595523510, "banned" : false, "uri" : "520290d7f45e5811fe5af637d328e7fbf5e8cab9",
* "removed" : 0, "conversationId": "6a61013979964f70c8fb9183a8b238d58a1846ed" }
*/
@Override
public Contact deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)

View File

@ -26,22 +26,11 @@ public class ConversationAdapter
implements JsonSerializer<Conversation>, JsonDeserializer<Conversation> {
/**
* {
* "created" : 1701180312,
* "erased" : 1701180454,
* "id" : "63afe87b8b18a3cfc40a4524ebd441c4a7d2336a",
* "lastDisplayed" : "63afe87b8b18a3cfc40a4524ebd441c4a7d2336a",
* "members" :
* [
* {
* "uri" : "7172ad8cf00c93235886d8ce1b2889638c0da68d"
* },
* {
* "uri" : "bf82b61537582a53fb0a28553f77060cc7a332c3"
* }
* ],
* "removed" : 1701180454
* }
* { "created" : 1701180312, "erased" : 1701180454, "id" :
* "63afe87b8b18a3cfc40a4524ebd441c4a7d2336a", "lastDisplayed" :
* "63afe87b8b18a3cfc40a4524ebd441c4a7d2336a", "members" : [ { "uri" :
* "7172ad8cf00c93235886d8ce1b2889638c0da68d" }, { "uri" :
* "bf82b61537582a53fb0a28553f77060cc7a332c3" } ], "removed" : 1701180454 }
*/
@Override
public Conversation deserialize(

View File

@ -26,17 +26,9 @@ public class ConversationRequestAdapter
implements JsonSerializer<ConversationRequest>, JsonDeserializer<ConversationRequest> {
/**
* {
* "conversationId" : "b158323bd68c7f71f606e0a4fb505f59a8212afe",
* "from" : "89c5c8d61df665f9dde97a23666772bccb658c22",
* "metadatas" :
* {
* "avatar" : "",
* "title" : " "
* },
* "received" : 1701188208
* }
*
* { "conversationId" : "b158323bd68c7f71f606e0a4fb505f59a8212afe", "from" :
* "89c5c8d61df665f9dde97a23666772bccb658c22", "metadatas" : { "avatar" : "", "title" : " " },
* "received" : 1701188208 }
*/
@Override
public ConversationRequest deserialize(

View File

@ -45,11 +45,9 @@ public class AppStarter extends Thread {
private long jamsProcessId = -1L;
/**
* The launcher is essentially responsible of firing up the main application
* JAR.
* The problematic here is whenever we will fire up a JAR (but then we need to
* be able to
* kill and restart his PID, or whenever we fork via a main).
* The launcher is essentially responsible of firing up the main application JAR. The
* problematic here is whenever we will fire up a JAR (but then we need to be able to kill and
* restart his PID, or whenever we fork via a main).
*/
private void setupZmqBridge() {
publisher = context.socket(SocketType.PUB);

View File

@ -43,8 +43,9 @@
"eject": "react-scripts eject",
"install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
"format": "prettier --write --loglevel warn 'src/**/*.{js,jsx,ts,tsx}'",
"lint:check": "eslint . --ext=js,jsx,ts,tsx; exit 0",
"lint:fix": "eslint . --ext=js,jsx,ts,tsx --fix; exit 0",
"lint:check": "eslint . --ext=js,jsx,ts,tsx",
"lint:fix": "eslint . --ext=js,jsx,ts,tsx --fix",
"compile": "tsc",
"build-package-css": "cp src/assets/css/material-dashboard-react.css dist/material-dashboard-react.css",
"build-package": "npm run build-package-css && babel src --out-dir dist"
},

View File

@ -52,9 +52,7 @@ public class LoginServlet extends HttpServlet {
* @apiGroup Login
* @apiParam {header} [authorization] classical HTTP auth header
* @apiParam {attribute} [X509Certificate] X509 User certificate
* @apiParam {body} [LoginRequest] username/password sent to server as JSON
* object
*
* @apiParam {body} [LoginRequest] username/password sent to server as JSON object
* @apiSuccess (200) {body} AuthTokenResponse the 0Auth authentication token
* @apiError (403) {null} null The user is unauthorized
*/

View File

@ -45,11 +45,9 @@ public class ContactServlet extends HttpServlet {
* @api {get} /api/auth/contacts View contacts
* @apiName getContact
* @apiGroup Contacts
*
* @apiSuccess (200) {body} Contact[] List of contacts for the user
* @apiSuccessExample {json} Success-Response: [{ "uri": "jami://7e3ab29383",
* "added": 18272662662 }, { "uri": "jami://7e3ab29383",
* "removed": 12387873 }, ]
* @apiSuccessExample {json} Success-Response: [{ "uri": "jami://7e3ab29383", "added":
* 18272662662 }, { "uri": "jami://7e3ab29383", "removed": 12387873 }, ]
*/
@Override
@ScopedServletMethod(securityGroups = {AccessLevel.ADMIN})
@ -67,11 +65,8 @@ public class ContactServlet extends HttpServlet {
* @api {put} /api/auth/contacts Add contact
* @apiName putContact
* @apiGroup Contacts
*
* @apiParam {body} Contact JSON representation of the contact object
* @apiParamExample {json} Request-Example:
* { "uri": "jami://7e3ab29383" }
*
* @apiParamExample {json} Request-Example: { "uri": "jami://7e3ab29383" }
* @apiSuccess (200) {null} null successfully added contact
* @apiError (500) {null} null contact could not be successfully added
*/
@ -89,9 +84,7 @@ public class ContactServlet extends HttpServlet {
* @api {delete} /api/auth/contacts Delete a contact
* @apiName deleteContact
* @apiGroup Contacts
*
* @apiParam {query} uri uri of the contact to delete
*
* @apiSuccess (200) {null} null successfully deleted contact
* @apiError (500) {null} null contact could not be successfully deleted
*/
@ -112,12 +105,9 @@ public class ContactServlet extends HttpServlet {
* @api {post} /api/auth/contacts Sync contact list
* @apiName putContact
* @apiGroup Contacts
*
* @apiParam {body} Contact JSON representation of the contact object
* @apiParamExample {json} Request-Example: [
* {"uri":"tcp://def@local","added":1594742298377},
* {"uri":"tcp://abc@19293.com","removed":1594742298377} ]
*
* @apiParamExample {json} Request-Example: [ {"uri":"tcp://def@local","added":1594742298377},
* {"uri":"tcp://abc@19293.com","removed":1594742298377} ]
* @apiSuccess (200) {json} Contact[] successfully added contact
* @apiError (500) {null} null contact could not be successfully added
*/

View File

@ -49,12 +49,8 @@ public class UserGroupServlet extends HttpServlet {
* @api {get} /api/admin/group/[groupId]/members/ Get JAMS groups members
* @apiName getGroupMembers
* @apiGroup Group
*
* @apiSuccess (200) {body} Array of usernames
* @apiSuccessExample {json} Success-Response:
* {
* "usernames": ["user1", "user2", "user3"]
* }
* @apiSuccessExample {json} Success-Response: { "usernames": ["user1", "user2", "user3"] }
* @apiError (404) {null} null could not find members for this groups
*/
@Override

View File

@ -47,12 +47,9 @@ public class UserGroupsServlet extends HttpServlet {
* @api {get} /api/admin/user/[username]/groups/ Get JAMS user groups
* @apiName getUserGroups
* @apiGroup User
*
* @apiSuccess (200) {body} User json user object representation
* @apiSuccessExample {json} Success-Response:
* {
* "groups": ["a5085350-3348-11eb-adc1-0242ac120002", "abde9b76-3348-11eb-adc1-0242ac120002"]
* }
* @apiSuccessExample {json} Success-Response: { "groups":
* ["a5085350-3348-11eb-adc1-0242ac120002", "abde9b76-3348-11eb-adc1-0242ac120002"] }
* @apiError (404) {null} null could not find groups for this user
*/
@Override

View File

@ -45,11 +45,9 @@ public class ContactServlet extends HttpServlet {
* @api {get} /api/auth/contacts View contacts
* @apiName getContact
* @apiGroup Contacts
*
* @apiSuccess (200) {body} Contact[] List of contacts for the user
* @apiSuccessExample {json} Success-Response: [{ "uri": "jami://7e3ab29383",
* "added": 18272662662 }, { "uri": "jami://7e3ab29383",
* "removed": 12387873 }, ]
* @apiSuccessExample {json} Success-Response: [{ "uri": "jami://7e3ab29383", "added":
* 18272662662 }, { "uri": "jami://7e3ab29383", "removed": 12387873 }, ]
*/
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
@ -65,11 +63,8 @@ public class ContactServlet extends HttpServlet {
* @api {put} /api/auth/contacts Add contact
* @apiName putContact
* @apiGroup Contacts
*
* @apiParam {body} Contact JSON representation of the contact object
* @apiParamExample {json} Request-Example:
* { "uri": "jami://7e3ab29383" }
*
* @apiParamExample {json} Request-Example: { "uri": "jami://7e3ab29383" }
* @apiSuccess (200) {null} null successfully added contact
* @apiError (500) {null} null contact could not be successfully added
*/
@ -108,9 +103,7 @@ public class ContactServlet extends HttpServlet {
* @api {delete} /api/auth/contacts Delete a contact
* @apiName deleteContact
* @apiGroup Contacts
*
* @apiParam {query} uri uri of the contact to delete
*
* @apiSuccess (200) {null} null successfully deleted contact
* @apiError (500) {null} null contact could not be successfully deleted
*/
@ -131,12 +124,9 @@ public class ContactServlet extends HttpServlet {
* @api {post} /api/auth/contacts Sync contact list
* @apiName putContact
* @apiGroup Contacts
*
* @apiParam {body} Contact JSON representation of the contact object
* @apiParamExample {json} Request-Example: [
* {"uri":"tcp://def@local","added":1594742298377},
* {"uri":"tcp://abc@19293.com","removed":1594742298377} ]
*
* @apiParamExample {json} Request-Example: [ {"uri":"tcp://def@local","added":1594742298377},
* {"uri":"tcp://abc@19293.com","removed":1594742298377} ]
* @apiSuccess (200) {json} Contact[] successfully added contact
* @apiError (500) {null} null contact could not be successfully added
*/

View File

@ -45,13 +45,10 @@ public class ConversationRequestServlet extends HttpServlet {
* @api {post} /api/auth/conversationRequests Sync conversationRequest list
* @apiName postConversationRequests
* @apiGroup ConversationRequests
*
* @apiParam {body} Conversation JSON representation of the conversationRequest
* object
* @apiParam {body} Conversation JSON representation of the conversationRequest object
* @apiParamExample {json} Request-Example: [
* {"conversationId":"1231221","received":1594742298377},
* {"conversationId":"213123","declined":1594742298377} ]
*
* {"conversationId":"1231221","received":1594742298377},
* {"conversationId":"213123","declined":1594742298377} ]
* @apiSuccess (200) {json} ConversationRequest[] user's converationRequests
* @apiError (500) {null} null contact could not be successfully added
*/

View File

@ -44,12 +44,9 @@ public class ConversationServlet extends HttpServlet {
* @api {post} /api/auth/conversations Sync conversation list
* @apiName postConversations
* @apiGroup Conversations
*
* @apiParam {body} Conversation JSON representation of the conversation object
* @apiParamExample {json} Request-Example: [
* {"id":"1231221","created":1594742298377},
* {"id":"213123","removed":1594742298377} ]
*
* @apiParamExample {json} Request-Example: [ {"id":"1231221","created":1594742298377},
* {"id":"213123","removed":1594742298377} ]
* @apiSuccess (200) {json} Conversation[] user's conversations
* @apiError (500) {null} null conversation could not be successfully synced
*/

View File

@ -50,17 +50,10 @@ public class DeviceServlet extends HttpServlet {
* @api {get} /api/auth/device Get device info
* @apiName getDevice
* @apiGroup Device
*
* @apiParam {path} deviceId id of the device
*
* @apiSuccess (200) {body} Device device information
* @apiSuccessExample {json} Success-Response:
* {
* "certificate":"pem_encoded_certificate",
* "displayName":"My Galaxy S8",
* "deviceId":"6aec6252ad",
* "revoked":true
* }
* @apiSuccessExample {json} Success-Response: { "certificate":"pem_encoded_certificate",
* "displayName":"My Galaxy S8", "deviceId":"6aec6252ad", "revoked":true }
* @apiError (500) {null} null Device could not be retrieved
*/
@Override
@ -91,25 +84,15 @@ public class DeviceServlet extends HttpServlet {
* @api {post} /api/auth/device Enroll a device
* @apiName postDevice
* @apiGroup Device
*
* @apiParam {body} DeviceRegistrationRequest device registration request
* @apiParamExample {json} Request-Example:
* {
* "csr":"pem_encoded_csr",
* "deviceName":"My Galaxy S8"
* }
*
* @apiParamExample {json} Request-Example: { "csr":"pem_encoded_csr", "deviceName":"My Galaxy
* S8" }
* @apiSuccess (200) {body} DeviceRegistrationResponse registration response
* @apiError (500) {null} null Device could not be enrolled
* @apiSuccessExample {json} Success-Response:
* {
* "certificateChain":"pem_encoded_certificate_chain",
* "displayName":"John Doe",
* "nameServer":"https://mydomain.com",
* "deviceReceipt": "device_receipt_object",
* "receiptSignature":"receipt_signature_object",
* "userPhoto":"base64_encoded_photo"
* }
* @apiSuccessExample {json} Success-Response: {
* "certificateChain":"pem_encoded_certificate_chain", "displayName":"John Doe",
* "nameServer":"https://mydomain.com", "deviceReceipt": "device_receipt_object",
* "receiptSignature":"receipt_signature_object", "userPhoto":"base64_encoded_photo" }
*/
@Override
@ScopedServletMethod(securityGroups = {AccessLevel.USER})
@ -184,10 +167,8 @@ public class DeviceServlet extends HttpServlet {
* @api {put} /api/auth/device Change the name of a device
* @apiName putDevice
* @apiGroup Device
*
* @apiParam {path} deviceId id of the device
* @apiParam {query} deviceName new name for the device
*
* @apiSuccess (200) {null} null name changed successfully
* @apiError (500) {null} null device name could not be changed
*/
@ -210,9 +191,7 @@ public class DeviceServlet extends HttpServlet {
* @api {delete} /api/auth/device Deactivate a device
* @apiName deleteDevice
* @apiGroup Device
*
* @apiParam {path} deviceId id of the device
*
* @apiSuccess (200) {null} null device successfully deactivated
* @apiError (500) {null} null device could not be deactivated
*/

View File

@ -42,16 +42,9 @@ public class DevicesServlet extends HttpServlet {
* @api {get} /api/auth/devices Get device info
* @apiName getDevices
* @apiGroup Devices
*
*
* @apiSuccess (200) {body} Device device information
* @apiSuccessExample {json} Success-Response:
* [{
* "certificate":"pem_encoded_certificate",
* "displayName":"My Galaxy S8",
* "deviceId":"6aec6252ad",
* "revoked":true
* }]
* @apiSuccessExample {json} Success-Response: [{ "certificate":"pem_encoded_certificate",
* "displayName":"My Galaxy S8", "deviceId":"6aec6252ad", "revoked":true }]
* @apiError (500) {null} null Device could not be retrieved
*/
@Override

View File

@ -40,23 +40,9 @@ public class DirectoriesServlet extends HttpServlet {
* @api {get} /api/auth/directories Return the list of directories
* @apiName getDirectories
* @apiGroup Directories
*
*
* @apiSuccess (200) {body} AuthModuleKey[] array of available authentication sources
* @apiSuccessExample {json} Success-Response:
* [{
* "realm":"savoirfairelinux",
* "type":"LDAP"
* },
* {
* "realm":"LOCAL",
* "type":"LOCAL"
* },
* ...
* {
* "realm":"savoirfairelinux-ad",
* "type":"AD"
* }]
* @apiSuccessExample {json} Success-Response: [{ "realm":"savoirfairelinux", "type":"LDAP" }, {
* "realm":"LOCAL", "type":"LOCAL" }, ... { "realm":"savoirfairelinux-ad", "type":"AD" }]
* @apiError (500) {null} null could not return any authentication sources
*/
@Override

View File

@ -51,145 +51,127 @@ public class DirectoryEntryServlet extends HttpServlet {
* @api {get} /api/auth/directory/entry Return the user's profile within a directory
* @apiName getDirectoryEntry
* @apiGroup Directory Entries
*
* @apiParam {query} [directory] name of the directory
* @apiParam {query} [directoryType] type of the directory
* @apiParam {query=vcard} [format=json] output format
* @apiParam {query} [username] username we are looking for
*
* @apiSuccess (200) {body} UserProfile json-representation of the user profile
* @apiSuccessExample {json} Success-Response:
* {
* "username":"jdoe",
* "firstName":"John",
* "lastName":"Doe",
* "phoneNumber":"+1-514-000-0000",
* "phoneNumberExtension":"363",
* "mobileNumber":"+1-514-000-0000",
* "faxNumber":"+1-514-000-0000",
* "profilePicture":"base64_encoded_picture",
* "email":"jdoe@savoirfairelinux.com",
* "organization":"SFL"
* }
*
* @apiSuccessExample {json} Success-Response: { "username":"jdoe", "firstName":"John",
* "lastName":"Doe", "phoneNumber":"+1-514-000-0000", "phoneNumberExtension":"363",
* "mobileNumber":"+1-514-000-0000", "faxNumber":"+1-514-000-0000",
* "profilePicture":"base64_encoded_picture", "email":"jdoe@savoirfairelinux.com",
* "organization":"SFL" }
* @apiSuccess (200) {body} vCard vcard-representation of the user profile
* @apiSuccessExample {vCard} Success-Response:
* BEGIN:VCARD
* VERSION:3.0
* PRODID:ez-vcard 0.10.6
* N:B%C3%A9raud;Adrien
* TEL;TYPE=work:176
* EMAIL;TYPE=work:adrien.beraud@savoirfairelinux.com
* ORG:Savoir-faire Linux
* PHOTO;ENCODING=b;TYPE=jpeg:/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDA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b
* gUN4JycHFS4iJiOv0JanStCt0rPI9xquC/Kiy+BES5sWzy7/DbC03BaWVqyk4UFkgBKu/G6o/j
* WyMbhX9Kn3YuNDNlCpCuG602lGabUcLgWD3OymrpCHO33aWfHU1z905XIfZYICoAKACgAoAtO+
* FjHW70d9RFJSB+lEgfUP7pErVi6FZIzUqCliS0s7wIIP3Vsx9iv9GFsiSJFkU2sklMkjPiAABR
* qOGV4/Y8kZ8IQd0EBIxWEuETqCap6eloZCc5PnWhKuRq4FVp2CjcbzxzSN+xbOi+uBV7ZZSnCG
* xk+dEOmTXFn3abe1NuK5CkBUnPBazwAqzJN44JixW5m3upBiP+BTjFVZOUEexGzd8QT1RCFkcD
* jIFTBFjEuxd3ZKy3I4q3uJQcCtTjwV3ydeocx1IO8paCnO6fGscPMs9DUaifMjVcdH2A4pBVj+
* wFY/8AatuLlOyqXY6+i0YtchZP1OLFVZnZMOymPpBcNve0r1NcvdOVzX2OxA1ABQB//9k=
* END:VCARD
*
* @apiSuccessExample {vCard} Success-Response: BEGIN:VCARD VERSION:3.0 PRODID:ez-vcard 0.10.6
* N:B%C3%A9raud;Adrien TEL;TYPE=work:176 EMAIL;TYPE=work:adrien.beraud@savoirfairelinux.com
* ORG:Savoir-faire Linux
* PHOTO;ENCODING=b;TYPE=jpeg:/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwME
* AwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2w
* BDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU
* FBQUFBQUFBQUFBT/wAARCACWAJYDAREAAhEBAxEB/8QAHgAAAQQCAwEAAAAAAAAAAAAAAAYHCA
* kEBQEDCgL/xABEEAABAwMBBAgDBAUKBwAAAAABAgMEAAURBgcSITEIEzhBUWF2tAkUIjJxgaEW
* IyRSkRUlM0J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BUnPBazwAqzJN44JixW5m3upBiP+BTjFVZOUEexGzd8QT1RCFkcD
* jIFTBFjEuxd3ZKy3I4q3uJQcCtTjwV3ydeocx1IO8paCnO6fGscPMs9DUaifMjVcdH2A4pBVj+
* wFY/8AatuLlOyqXY6+i0YtchZP1OLFVZnZMOymPpBcNve0r1NcvdOVzX2OxA1ABQB//9k= END:VCARD
* @apiError (500) {null} null could not return any authentication sources
*/
@Override

View File

@ -39,27 +39,14 @@ public class PolicyDataServlet extends HttpServlet {
* @api {get} /api/auth/policyData Get policy data
* @apiName getPolicyData
* @apiGroup Policy Data
*
*
* @apiSuccess (200) {body} Policy Data
* @apiSuccessExample {json} Success-Response:
* [{
* "allowCertFromHistory": true,
* "allowLookup": true,
* "allowCertFromContact": true,
* "allowCertFromTrusted": true,
* "Account.videoEnabled": true,
* "DHTRelay.PublicInCalls": false,
* "Account.autoAnswer": false,
* "Account.peerDiscovery": true,
* "Account.accountDiscovery": true,
* "Account.accountPublish": true,
* "Account.rendezVous": false,
* "Account.upnpEnabled": true,
* "Account.defaultModerators": "",
* "Account.uiCustomization":
* "{\"areTipsEnabled\":false,\"backgroundType\":\"default\"}"
* }]
* @apiSuccessExample {json} Success-Response: [{ "allowCertFromHistory": true, "allowLookup":
* true, "allowCertFromContact": true, "allowCertFromTrusted": true, "Account.videoEnabled":
* true, "DHTRelay.PublicInCalls": false, "Account.autoAnswer": false,
* "Account.peerDiscovery": true, "Account.accountDiscovery": true,
* "Account.accountPublish": true, "Account.rendezVous": false, "Account.upnpEnabled": true,
* "Account.defaultModerators": "", "Account.uiCustomization":
* "{\"areTipsEnabled\":false,\"backgroundType\":\"default\"}" }]
* @apiError (404) {null} null Policy Data could not be retrieved
* @apiError (500) {null} null Policy Data could not be retrieved
*/

View File

@ -46,23 +46,12 @@ public class UserServlet extends HttpServlet {
* @api {get} /api/auth/user Get JAMS user info
* @apiName getUser
* @apiGroup User
*
* @apiSuccess (200) {body} User json user object representation
* @apiSuccessExample {json} Success-Response:
* {
* "username":"jdoe",
* "password":null,
* "userType":"AD",
* "realm":"savoirfairelinux",
* "accessLevel":"USER",
* "needsPasswordReset":false,
* "ethAddress":"8272773ac",
* "ethKey":"192938ae72772ab",
* "jamiId":"6e3552723df",
* "certificate":"pem_formatted_certificate",
* "privateKey":"pem_formatted_key",
* "revoked":false
* }
* @apiSuccessExample {json} Success-Response: { "username":"jdoe", "password":null,
* "userType":"AD", "realm":"savoirfairelinux", "accessLevel":"USER",
* "needsPasswordReset":false, "ethAddress":"8272773ac", "ethKey":"192938ae72772ab",
* "jamiId":"6e3552723df", "certificate":"pem_formatted_certificate",
* "privateKey":"pem_formatted_key", "revoked":false }
* @apiError (500) {null} null could not fetch user information
*/
@Override
@ -98,7 +87,6 @@ public class UserServlet extends HttpServlet {
* @apiName putUser
* @apiGroup User
* @apiParam {query} password new password
*
* @apiSuccess (200) {null} null password successfully changed
* @apiError (500) {null} null could not changed password
*/

View File

@ -50,15 +50,12 @@ public class FileHandlerServlet extends HttpServlet {
/**
* @apiVersion 1.0.0
* @api {post} /api/image/filehandler/<blueprintName>/<imageType>
* Upload an image
* @api {post} /api/image/filehandler/<blueprintName>/<imageType> Upload an image
* @apiName postImage
* @apiGroup Images
*
* @apiParam {param} blueprintName The name of the blueprint
* @apiParam {param} imageType 'logo' or 'background'
* @apiParam {body} image The new logo image or background image
*
* @apiSuccess (200) {null} null successfully uploaded image
* @apiError (400) {null} null missing path info
* @apiError (500) {null} null contact could not be successfully added
@ -121,15 +118,12 @@ public class FileHandlerServlet extends HttpServlet {
/**
* @apiVersion 1.0.0
* @api {get} /api/image/filehandler/<blueprintName>/<imageType>/<fileName>
* Get an image
* @api {get} /api/image/filehandler/<blueprintName>/<imageType>/<fileName> Get an image
* @apiName getImage
* @apiGroup Images
*
* @apiParam {param} blueprintName The name of the blueprint
* @apiParam {param} imageType 'logo' or 'background'
* @apiParam {param} fileName The name of the file
*
* @apiSuccess (200) {null} null successfully got image
* @apiError (400) {null} null missing path info
* @apiError (404) {null} null image not found

View File

@ -42,13 +42,8 @@ public class AddressServlet extends HttpServlet {
* @api {get} /api/nameserver/addr/* Lookup user from address
* @apiName getAddr
* @apiGroup NameServer
*
* @apiSuccess (200) {path} String username
* @apiSuccessExample {json} Success-Response:
*{
* "name": "sidokhine6"
* }
*
* @apiSuccessExample {json} Success-Response: { "name": "sidokhine6" }
* @apiError (404) {null} null Address does not exist
* @apiError (500) {null} null could not fetch user information
*/

View File

@ -41,15 +41,9 @@ public class NameServlet extends HttpServlet {
* @api {get} /api/nameserver/name/* Look up a user on the nameserver
* @apiName getName
* @apiGroup NameServer
*
* @apiSuccess (200) {path} String username
* @apiSuccessExample {json} Success-Response:
* {
* "publickey": "",
* "signature": "",
* "name": "sidokhine6",
* "addr": "0d1f0002ce728d6aa8b98b5227c75fc773735f9e"
* }
* @apiSuccessExample {json} Success-Response: { "publickey": "", "signature": "", "name":
* "sidokhine6", "addr": "0d1f0002ce728d6aa8b98b5227c75fc773735f9e" }
* @apiError (404) {null} null user does not exist
* @apiError (500) {null} null could not fetch user information
*/

View File

@ -36,9 +36,8 @@ import net.jami.jams.server.Server;
import java.io.IOException;
/**
* Since we have the @ScopedServletMethod annotation, the admin filter became
* absolutely useless
* as we can simply scope things.
* Since we have the @ScopedServletMethod annotation, the admin filter became absolutely useless as
* we can simply scope things.
*/
@WebFilter(urlPatterns = {"/api/auth/*", "/api/admin/*"})
@Slf4j