slackin/authentication

Types

A Slack signing secret.

pub type SigningSecret {
  SigningSecret(String)
}

Constructors

  • SigningSecret(String)

The X-Slack-Request-Timestamp header for a request.

pub type XSlackRequestTimestamp {
  XSlackRequestTimestamp(Int)
}

Constructors

  • XSlackRequestTimestamp(Int)

The X-Slack-Signature header for a request.

pub type XSlackSignature {
  XSlackSignature(String)
}

Constructors

  • XSlackSignature(String)

Functions

pub fn read_x_slack_request_timestamp(
  req: Request(a),
) -> Result(XSlackRequestTimestamp, Nil)

Reads the X-Slack-Request-Timestamp header from the request.

pub fn read_x_slack_signature(
  req: Request(a),
) -> Result(XSlackSignature, Nil)

Reads the X-Slack-Signature header from the request.

pub fn verify_slack_request(
  signing_secret: SigningSecret,
  x_slack_signature: XSlackSignature,
  x_slack_request_timestamp: XSlackRequestTimestamp,
  body: String,
) -> Result(Nil, Nil)

Verifies an HTTP request from Slack.

Slack Docs: Verifying requests from Slack

Search Document