jimsynz

jimsynz

Ash Core Team

Alembic is pleased to announce the public availability of ash_authentication - an Ash extension which provides a drop-in authentication solution for users of Ash framework. Out of the box it provides password-based authentication (including resets and confirmation), OAuth 2.0 sign in and a set of customisable components for Phoenix LiveView.

If you’re sick of reinventing the wheel instead of adding value to your applications, then come join us on the Ash productivity journey by reading the full announcement, following the Getting Started Guide or engaging us to build your next Elixir, Phoenix or Ash application.

Showing Posts 1 to 6

dmarcoux

dmarcoux

Do you have an estimate of when Ash Authentication will leave beta?

I’m asking since there is this note in the project’s README:

This is beta software. Please don’t use it without talking to us!

zachdaniel

zachdaniel

Creator of Ash

Hey! So I’ll remove the beta warning from the readme. We don’t see it as beta anymore, but just want people to apply a healthy amount of caution since the package is relatively young and implements a very critical set of flows.

EDIT: beta warning removed, replaced with another warning about taking care when configuring the package, and encouragement to test your implementation.

gastonrey

gastonrey

Hi guys, quick question, I created a json api using ETS data layer but not sure how to serialize the response, actual object contains lot of information that I do not want to expose, I just need id, name, etc. Could find this out on documentation, any help?

zachdaniel

zachdaniel

Creator of Ash

Generally speaking, the way that you hide attributes like that is by marking them as private. For example:

attributes do
  attribute :name, :string
  attribute :sensitive_thing, :string do
    private? true # use this to hide from external interfaces to the resource
    sensitive? true # scrub from logs
  end
end

Just keep in mind that private attributes are also not meant to be writable and so are not accepted by actions by default. So if you want a create action that sets those attributes for internal use, you might do something like this:

create :create do
  argument :sensitive_thing, :string # make an argument with the same name (or a different name, doesn't matter)
  change set_attribute(:sensitive_thing, arg(:sensitive_thing)) # use the builtin `change` to set a private attribute
end
gastonrey

gastonrey

Thanks for the quick reply!! What I mean is this returned structure:

I would like to just return {id, subject, status}. Also the way body is passed would like to simplify like just subject and status. Couldn´t figure it out on doc.

zachdaniel

zachdaniel

Creator of Ash

Ah, so ash_json_api is built to create JSON:API specification compliant APIs: https://jsonapi.org/

If you want to create a simple API like that, you’d need to roll your own. Thankfully, a simple phoenix controller (or plug) calling your resource actions should get you what you need. We’re investigating a simple_json_api extension (maybe with a better name for it) that will do similar work to ash_json_api but for simpler structures.

So at this point, you can’t do what you want with ash_json_api, but you can still use your resources, which might look something like this:

defmodule ...TicketsController do
  def index(conn, params) do
    json = 
      Helpdesk.Tickets.Ticket
      |> Helpdesk.Tickets.read!()
      |> Enum.map(&Map.take(&1, [:status, :subject, :id]))

    conn
    |> put_status(:ok)
    |> json(json)
  end
end
— All posts loaded —

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
rodloboz
I’ve started working on a new library to run SQL queries and do basic business intelligence. Think “Blazer for Elixir.” Currently it fe...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews